Show More
@@ -1053,6 +1053,7 b' class AuthUser(object):' | |||
|
1053 | 1053 | GLOBAL_PERMS = [x[0] for x in Permission.PERMS] |
|
1054 | 1054 | repo_read_perms = ['repository.read', 'repository.admin', 'repository.write'] |
|
1055 | 1055 | repo_group_read_perms = ['group.read', 'group.write', 'group.admin'] |
|
1056 | user_group_read_perms = ['usergroup.read', 'usergroup.write', 'usergroup.admin'] | |
|
1056 | 1057 | |
|
1057 | 1058 | def __init__(self, user_id=None, api_key=None, username=None, ip_addr=None): |
|
1058 | 1059 | |
@@ -1292,7 +1293,7 b' class AuthUser(object):' | |||
|
1292 | 1293 | |
|
1293 | 1294 | def repo_acl_ids_from_stack(self, perms=None, prefix_filter=None, cache=False): |
|
1294 | 1295 | if not perms: |
|
1295 | perms = ['repository.read', 'repository.write', 'repository.admin'] | |
|
1296 | perms = AuthUser.repo_read_perms | |
|
1296 | 1297 | allowed_ids = [] |
|
1297 | 1298 | for k, stack_data in self.permissions['repositories'].perm_origin_stack.items(): |
|
1298 | 1299 | perm, origin, obj_id = stack_data[-1] # last item is the current permission |
@@ -1310,7 +1311,7 b' class AuthUser(object):' | |||
|
1310 | 1311 | """ |
|
1311 | 1312 | from rhodecode.model.scm import RepoList |
|
1312 | 1313 | if not perms: |
|
1313 | perms = ['repository.read', 'repository.write', 'repository.admin'] | |
|
1314 | perms = AuthUser.repo_read_perms | |
|
1314 | 1315 | |
|
1315 | 1316 | def _cached_repo_acl(user_id, perm_def, _name_filter): |
|
1316 | 1317 | qry = Repository.query() |
@@ -1326,7 +1327,7 b' class AuthUser(object):' | |||
|
1326 | 1327 | |
|
1327 | 1328 | def repo_group_acl_ids_from_stack(self, perms=None, prefix_filter=None, cache=False): |
|
1328 | 1329 | if not perms: |
|
1329 | perms = ['group.read', 'group.write', 'group.admin'] | |
|
1330 | perms = AuthUser.repo_group_read_perms | |
|
1330 | 1331 | allowed_ids = [] |
|
1331 | 1332 | for k, stack_data in self.permissions['repositories_groups'].perm_origin_stack.items(): |
|
1332 | 1333 | perm, origin, obj_id = stack_data[-1] # last item is the current permission |
@@ -1344,7 +1345,7 b' class AuthUser(object):' | |||
|
1344 | 1345 | """ |
|
1345 | 1346 | from rhodecode.model.scm import RepoGroupList |
|
1346 | 1347 | if not perms: |
|
1347 | perms = ['group.read', 'group.write', 'group.admin'] | |
|
1348 | perms = AuthUser.repo_group_read_perms | |
|
1348 | 1349 | |
|
1349 | 1350 | def _cached_repo_group_acl(user_id, perm_def, _name_filter): |
|
1350 | 1351 | qry = RepoGroup.query() |
@@ -1360,7 +1361,7 b' class AuthUser(object):' | |||
|
1360 | 1361 | |
|
1361 | 1362 | def user_group_acl_ids_from_stack(self, perms=None, cache=False): |
|
1362 | 1363 | if not perms: |
|
1363 | perms = ['usergroup.read', 'usergroup.write', 'usergroup.admin'] | |
|
1364 | perms = AuthUser.user_group_read_perms | |
|
1364 | 1365 | allowed_ids = [] |
|
1365 | 1366 | for k, stack_data in self.permissions['user_groups'].perm_origin_stack.items(): |
|
1366 | 1367 | perm, origin, obj_id = stack_data[-1] # last item is the current permission |
@@ -1376,7 +1377,7 b' class AuthUser(object):' | |||
|
1376 | 1377 | """ |
|
1377 | 1378 | from rhodecode.model.scm import UserGroupList |
|
1378 | 1379 | if not perms: |
|
1379 | perms = ['usergroup.read', 'usergroup.write', 'usergroup.admin'] | |
|
1380 | perms = AuthUser.user_group_read_perms | |
|
1380 | 1381 | |
|
1381 | 1382 | def _cached_user_group_acl(user_id, perm_def, name_filter): |
|
1382 | 1383 | qry = UserGroup.query() |
General Comments 0
You need to be logged in to leave comments.
Login now