##// END OF EJS Templates
api: make comment_commits api have consistent permissions with web interface.
marcink -
r352:71dfb19a default
parent child Browse files
Show More
@@ -1310,8 +1310,6 b' def comment_commit('
1310 userid=Optional(OAttr('apiuser')), status=Optional(None)):
1310 userid=Optional(OAttr('apiuser')), status=Optional(None)):
1311 """
1311 """
1312 Set a commit comment, and optionally change the status of the commit.
1312 Set a commit comment, and optionally change the status of the commit.
1313 This command can be executed only using api_key belonging to user
1314 with admin rights, or repository administrator.
1315
1313
1316 :param apiuser: This is filled automatically from the |authtoken|.
1314 :param apiuser: This is filled automatically from the |authtoken|.
1317 :type apiuser: AuthUser
1315 :type apiuser: AuthUser
@@ -1344,7 +1342,7 b' def comment_commit('
1344 """
1342 """
1345 repo = get_repo_or_error(repoid)
1343 repo = get_repo_or_error(repoid)
1346 if not has_superadmin_permission(apiuser):
1344 if not has_superadmin_permission(apiuser):
1347 _perms = ('repository.admin',)
1345 _perms = ('repository.read', 'repository.write', 'repository.admin')
1348 has_repo_permissions(apiuser, repoid, repo, _perms)
1346 has_repo_permissions(apiuser, repoid, repo, _perms)
1349
1347
1350 if isinstance(userid, Optional):
1348 if isinstance(userid, Optional):
General Comments 0
You need to be logged in to leave comments. Login now