forked from Github-Mirrors/canaille
25 lines
749 B
Python
25 lines
749 B
Python
from flask import Blueprint
|
|
from flask_themer import render_template
|
|
from canaille.models import AuthorizationCode
|
|
from canaille.flaskutils import permissions_needed
|
|
|
|
|
|
bp = Blueprint("admin_authorizations", __name__)
|
|
|
|
|
|
@bp.route("/")
|
|
@permissions_needed("manage_oidc")
|
|
def index(user):
|
|
authorizations = AuthorizationCode.filter()
|
|
return render_template(
|
|
"admin/authorization_list.html", authorizations=authorizations
|
|
)
|
|
|
|
|
|
@bp.route("/<authorization_id>", methods=["GET", "POST"])
|
|
@permissions_needed("manage_oidc")
|
|
def view(user, authorization_id):
|
|
authorization = AuthorizationCode.get(authorization_id)
|
|
return render_template(
|
|
"admin/authorization_view.html", authorization=authorization, menuitem="admin"
|
|
)
|