diff --git a/rhodecode/api/tests/test_grant_user_group_permission_to_repo_group.py b/rhodecode/api/tests/test_grant_user_group_permission_to_repo_group.py --- a/rhodecode/api/tests/test_grant_user_group_permission_to_repo_group.py +++ b/rhodecode/api/tests/test_grant_user_group_permission_to_repo_group.py @@ -54,6 +54,8 @@ class TestGrantUserGroupPermissionFromRe self, name, perm, apply_to_children, user_util): user_group = user_util.create_user_group() repo_group = user_util.create_repo_group() + user_util.create_repo(parent=repo_group) + id_, params = build_data( self.apikey, 'grant_user_group_permission_to_repo_group', diff --git a/rhodecode/api/views/repo_group_api.py b/rhodecode/api/views/repo_group_api.py --- a/rhodecode/api/views/repo_group_api.py +++ b/rhodecode/api/views/repo_group_api.py @@ -451,7 +451,7 @@ def grant_user_permission_to_repo_group( perm = get_perm_or_error(perm, prefix='group.') apply_to_children = Optional.extract(apply_to_children) - perm_additions = [[user.user_id, perm, "user"]] + perm_additions = [[user.user_id, perm.permission_name, "user"]] try: RepoGroupModel().update_permissions(repo_group=repo_group, perm_additions=perm_additions, @@ -609,7 +609,7 @@ def grant_user_group_permission_to_repo_ apply_to_children = Optional.extract(apply_to_children) - perm_additions = [[user_group.users_group_id, perm, "user_group"]] + perm_additions = [[user_group.users_group_id, perm.permission_name, "user_group"]] try: RepoGroupModel().update_permissions(repo_group=repo_group, perm_additions=perm_additions,