endpoints.api.user: require useradmin for star ops
This commit is contained in:
parent
917dd6b674
commit
3780434279
1 changed files with 3 additions and 0 deletions
|
@ -705,6 +705,7 @@ class StarredRepositoryList(ApiResource):
|
|||
@parse_args
|
||||
@query_param('page', 'Offset page number. (int)', type=int)
|
||||
@query_param('limit', 'Limit on the number of results (int)', type=int)
|
||||
@require_user_admin
|
||||
def get(self, args):
|
||||
""" List all starred repositories. """
|
||||
page = args['page']
|
||||
|
@ -725,6 +726,7 @@ class StarredRepositoryList(ApiResource):
|
|||
@require_scope(scopes.READ_REPO)
|
||||
@nickname('createStar')
|
||||
@validate_json_request('NewStarredRepository')
|
||||
@require_user_admin
|
||||
def post(self):
|
||||
""" Star a repository. """
|
||||
user = get_authenticated_user()
|
||||
|
@ -755,6 +757,7 @@ class StarredRepositoryList(ApiResource):
|
|||
class StarredRepository(RepositoryParamResource):
|
||||
""" Operations for managing a specific starred repository. """
|
||||
@nickname('deleteStar')
|
||||
@require_user_admin
|
||||
def delete(self, namespace, repository):
|
||||
user = get_authenticated_user()
|
||||
repo = model.get_repository(namespace, repository)
|
||||
|
|
Reference in a new issue