permissions: use constant for fork enable/disable

This commit is contained in:
Milka Kuzminski 2021-03-24 16:52:47 +01:00
parent ae9f4779d2
commit 219a05baa4
4 changed files with 10 additions and 6 deletions

View file

@ -1212,7 +1212,7 @@ def fork_repo(request, apiuser, repoid, fork_name,
validate_repo_permissions(apiuser, repoid, repo, _perms)
# check if the regular user has at least fork permissions as well
if not HasPermissionAnyApi('hg.fork.repository')(user=apiuser):
if not HasPermissionAnyApi(PermissionModel.FORKING_ENABLED)(user=apiuser):
raise JSONRPCForbidden()
# check if user can set owner parameter