|
@@ -210,10 +210,9 @@ def list_sentry_privileges_by_authorizable(request):
|
|
|
roles = get_api(request.user).list_sentry_roles_by_group(groupName=groupName)
|
|
roles = get_api(request.user).list_sentry_roles_by_group(groupName=groupName)
|
|
|
|
|
|
|
|
for role in roles:
|
|
for role in roles:
|
|
|
- for privilege in get_api(request.user).list_sentry_privileges_by_role(role['name']): # authorizableHierarchy not working here?
|
|
|
|
|
- if privilege['database'] == authorizableHierarchy['db'] and ('table' not in authorizableHierarchy or privilege['table'] == authorizableHierarchy['table']):
|
|
|
|
|
- privilege['roleName'] = role['name']
|
|
|
|
|
- privileges.append(privilege)
|
|
|
|
|
|
|
+ for privilege in get_api(request.user).list_sentry_privileges_by_role(role['name'], authorizableHierarchy=authorizableHierarchy):
|
|
|
|
|
+ privilege['roleName'] = role['name']
|
|
|
|
|
+ privileges.append(privilege)
|
|
|
|
|
|
|
|
result['privileges'] = privileges
|
|
result['privileges'] = privileges
|
|
|
|
|
|
|
@@ -230,7 +229,6 @@ def bulk_delete_privileges(request):
|
|
|
|
|
|
|
|
try:
|
|
try:
|
|
|
checkedPaths = json.loads(request.POST['checkedPaths'])
|
|
checkedPaths = json.loads(request.POST['checkedPaths'])
|
|
|
- recursive = json.loads(request.POST['recursive'])
|
|
|
|
|
authorizableHierarchy = json.loads(request.POST['authorizableHierarchy'])
|
|
authorizableHierarchy = json.loads(request.POST['authorizableHierarchy'])
|
|
|
|
|
|
|
|
for path in [path['path'] for path in checkedPaths]:
|
|
for path in [path['path'] for path in checkedPaths]:
|
|
@@ -257,7 +255,6 @@ def bulk_add_privileges(request):
|
|
|
try:
|
|
try:
|
|
|
privileges = json.loads(request.POST['privileges'])
|
|
privileges = json.loads(request.POST['privileges'])
|
|
|
checkedPaths = json.loads(request.POST['checkedPaths'])
|
|
checkedPaths = json.loads(request.POST['checkedPaths'])
|
|
|
- recursive = json.loads(request.POST['recursive'])
|
|
|
|
|
authorizableHierarchy = json.loads(request.POST['authorizableHierarchy'])
|
|
authorizableHierarchy = json.loads(request.POST['authorizableHierarchy'])
|
|
|
|
|
|
|
|
privileges = [privilege for privilege in privileges if privilege['status'] == '']
|
|
privileges = [privilege for privilege in privileges if privilege['status'] == '']
|