mirror of
https://github.com/getredash/redash.git
synced 2026-05-09 12:01:08 -04:00
Record events for permission changes
This commit is contained in:
@@ -55,6 +55,14 @@ class ObjectPermissionsListResource(BaseResource):
|
||||
|
||||
permission = AccessPermission.grant(obj, access_type, grantee, self.current_user)
|
||||
|
||||
self.record_event({
|
||||
'action': 'grant_permission',
|
||||
'object_id': object_id,
|
||||
'object_type': object_type,
|
||||
'access_type': access_type,
|
||||
'grantee': grantee.id
|
||||
})
|
||||
|
||||
return permission.to_dict()
|
||||
|
||||
def delete(self, object_type, object_id):
|
||||
@@ -69,6 +77,14 @@ class ObjectPermissionsListResource(BaseResource):
|
||||
|
||||
AccessPermission.revoke(obj, grantee, access_type)
|
||||
|
||||
self.record_event({
|
||||
'action': 'revoke_permission',
|
||||
'object_id': object_id,
|
||||
'object_type': object_type,
|
||||
'access_type': access_type,
|
||||
'grantee': grantee.id
|
||||
})
|
||||
|
||||
|
||||
class CheckPermissionResource(BaseResource):
|
||||
def get(self, object_type, object_id, access_type):
|
||||
|
||||
Reference in New Issue
Block a user