Update to use workspace permissions
This commit is contained in:
parent
81af9f1c99
commit
31d85be949
@ -35,11 +35,14 @@ class AuditLog(object):
|
|||||||
return AuditEventQuery.get_all(pagination_opts)
|
return AuditEventQuery.get_all(pagination_opts)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_workspace_events(cls, user, workspace_id, pagination_opts):
|
def get_workspace_events(cls, user, workspace, pagination_opts=None):
|
||||||
Authorization.check_atat_permission(
|
Authorization.check_workspace_permission(
|
||||||
user, Permissions.VIEW_WORKSPACE_AUDIT_LOG, "view audit log"
|
user,
|
||||||
|
workspace,
|
||||||
|
Permissions.VIEW_WORKSPACE_AUDIT_LOG,
|
||||||
|
"view workspace audit log",
|
||||||
)
|
)
|
||||||
return AuditEventQuery.get_ws_events(workspace_id, pagination_opts)
|
return AuditEventQuery.get_ws_events(workspace.id, pagination_opts)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_by_resource(cls, resource_id):
|
def get_by_resource(cls, resource_id):
|
||||||
|
@ -95,7 +95,7 @@ def workspace_activity(workspace_id):
|
|||||||
)
|
)
|
||||||
pagination_opts = Paginator.get_pagination_opts(http_request)
|
pagination_opts = Paginator.get_pagination_opts(http_request)
|
||||||
audit_events = AuditLog.get_workspace_events(
|
audit_events = AuditLog.get_workspace_events(
|
||||||
g.current_user, workspace_id, pagination_opts
|
g.current_user, workspace, pagination_opts
|
||||||
)
|
)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user