endpoints.api.user: require useradmin for star ops

This commit is contained in:
Jimmy Zelinskie 2015-02-19 17:03:36 -05:00
parent 917dd6b674
commit 3780434279

View file

@ -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)