Link the org api calls to their related user resources.
This commit is contained in:
parent
4d551a079b
commit
83bc965556
8 changed files with 36 additions and 25 deletions
|
@ -4,7 +4,7 @@ from datetime import datetime, timedelta
|
|||
from flask.ext.restful import abort
|
||||
|
||||
from endpoints.api import (resource, nickname, ApiResource, query_param, parse_args,
|
||||
RepositoryParamResource, require_repo_admin)
|
||||
RepositoryParamResource, require_repo_admin, related_user_resource)
|
||||
from auth.permissions import AdministerOrganizationPermission, AdministerOrganizationPermission
|
||||
from auth.auth_context import get_authenticated_user
|
||||
from data import model
|
||||
|
@ -82,6 +82,7 @@ class RepositoryLogs(RepositoryParamResource):
|
|||
|
||||
|
||||
@resource('/v1/organization/<orgname>/logs')
|
||||
@related_user_resource(UserLogs)
|
||||
class OrgLogs(ApiResource):
|
||||
""" Resource for fetching logs for the entire organization. """
|
||||
@nickname('listOrgLogs')
|
||||
|
@ -89,7 +90,6 @@ class OrgLogs(ApiResource):
|
|||
@query_param('starttime', 'Earliest time from which to get logs. (%m/%d/%Y %Z)', type=str)
|
||||
@query_param('endtime', 'Latest time to which to get logs. (%m/%d/%Y %Z)', type=str)
|
||||
@query_param('performer', 'Username for which to filter logs.', type=str)
|
||||
# @org_api_call('list_user_logs')
|
||||
def get(self, args, orgname):
|
||||
""" List the logs for the specified organization. """
|
||||
permission = AdministerOrganizationPermission(orgname)
|
||||
|
|
Reference in a new issue