Check VIEW_WORKSPACE_MEMBERS permission
This commit is contained in:
@@ -63,8 +63,14 @@ def show_workspace(workspace_id):
|
|||||||
|
|
||||||
@bp.route("/workspaces/<workspace_id>/members")
|
@bp.route("/workspaces/<workspace_id>/members")
|
||||||
def workspace_members(workspace_id):
|
def workspace_members(workspace_id):
|
||||||
workspace = Workspaces.get(g.current_user, workspace_id)
|
user = g.current_user
|
||||||
return render_template("workspaces/members/index.html", workspace=workspace)
|
workspace = Workspaces.get(user, workspace_id)
|
||||||
|
if not Authorization.has_workspace_permission(
|
||||||
|
user, workspace, Permissions.VIEW_WORKSPACE_MEMBERS
|
||||||
|
):
|
||||||
|
raise UnauthorizedError(user, "view workspace members")
|
||||||
|
|
||||||
|
return render_template("workspace_members.html", workspace=workspace)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/workspaces/<workspace_id>/reports")
|
@bp.route("/workspaces/<workspace_id>/reports")
|
||||||
|
Reference in New Issue
Block a user