Make team API decorators more descriptive for better readability
This commit is contained in:
parent
b10608e277
commit
55b1ad49ed
1 changed files with 7 additions and 3 deletions
|
@ -120,6 +120,10 @@ def disallow_for_synced_team(except_robots=False):
|
||||||
return inner
|
return inner
|
||||||
|
|
||||||
|
|
||||||
|
disallow_nonrobots_for_synced_team = disallow_for_synced_team(except_robots=True)
|
||||||
|
disallow_all_for_synced_team = disallow_for_synced_team(except_robots=False)
|
||||||
|
|
||||||
|
|
||||||
@resource('/v1/organization/<orgname>/team/<teamname>')
|
@resource('/v1/organization/<orgname>/team/<teamname>')
|
||||||
@path_param('orgname', 'The name of the organization')
|
@path_param('orgname', 'The name of the organization')
|
||||||
@path_param('teamname', 'The name of the team')
|
@path_param('teamname', 'The name of the team')
|
||||||
|
@ -325,7 +329,7 @@ class TeamMember(ApiResource):
|
||||||
|
|
||||||
@require_scope(scopes.ORG_ADMIN)
|
@require_scope(scopes.ORG_ADMIN)
|
||||||
@nickname('updateOrganizationTeamMember')
|
@nickname('updateOrganizationTeamMember')
|
||||||
@disallow_for_synced_team(except_robots=True)
|
@disallow_nonrobots_for_synced_team
|
||||||
def put(self, orgname, teamname, membername):
|
def put(self, orgname, teamname, membername):
|
||||||
""" Adds or invites a member to an existing team. """
|
""" Adds or invites a member to an existing team. """
|
||||||
permission = AdministerOrganizationPermission(orgname)
|
permission = AdministerOrganizationPermission(orgname)
|
||||||
|
@ -363,7 +367,7 @@ class TeamMember(ApiResource):
|
||||||
|
|
||||||
@require_scope(scopes.ORG_ADMIN)
|
@require_scope(scopes.ORG_ADMIN)
|
||||||
@nickname('deleteOrganizationTeamMember')
|
@nickname('deleteOrganizationTeamMember')
|
||||||
@disallow_for_synced_team(except_robots=True)
|
@disallow_nonrobots_for_synced_team
|
||||||
def delete(self, orgname, teamname, membername):
|
def delete(self, orgname, teamname, membername):
|
||||||
""" Delete a member of a team. If the user is merely invited to join
|
""" Delete a member of a team. If the user is merely invited to join
|
||||||
the team, then the invite is removed instead.
|
the team, then the invite is removed instead.
|
||||||
|
@ -407,7 +411,7 @@ class InviteTeamMember(ApiResource):
|
||||||
""" Resource for inviting a team member via email address. """
|
""" Resource for inviting a team member via email address. """
|
||||||
@require_scope(scopes.ORG_ADMIN)
|
@require_scope(scopes.ORG_ADMIN)
|
||||||
@nickname('inviteTeamMemberEmail')
|
@nickname('inviteTeamMemberEmail')
|
||||||
@disallow_for_synced_team()
|
@disallow_all_for_synced_team
|
||||||
def put(self, orgname, teamname, email):
|
def put(self, orgname, teamname, email):
|
||||||
""" Invites an email address to an existing team. """
|
""" Invites an email address to an existing team. """
|
||||||
permission = AdministerOrganizationPermission(orgname)
|
permission = AdministerOrganizationPermission(orgname)
|
||||||
|
|
Reference in a new issue