Initial interfaces and support for team syncing worker
This commit is contained in:
parent
94b07e6de9
commit
eeadeb9383
12 changed files with 282 additions and 15 deletions
|
@ -6,7 +6,7 @@ from flask import request
|
|||
|
||||
import features
|
||||
|
||||
from app import billing as stripe, avatar, all_queues
|
||||
from app import billing as stripe, avatar, all_queues, authentication
|
||||
from endpoints.api import (resource, nickname, ApiResource, validate_json_request, request_error,
|
||||
related_user_resource, internal_only, require_user_admin, log_action,
|
||||
show_if, path_param, require_scope, require_fresh_login)
|
||||
|
@ -33,6 +33,8 @@ def team_view(orgname, team):
|
|||
|
||||
'repo_count': team.repo_count,
|
||||
'member_count': team.member_count,
|
||||
|
||||
'is_synced': team.is_synced,
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,7 +159,7 @@ class Organization(ApiResource):
|
|||
|
||||
teams = None
|
||||
if OrganizationMemberPermission(orgname).can():
|
||||
teams = model.team.get_teams_within_org(org)
|
||||
teams = model.team.get_teams_within_org(org, bool(authentication.federated_service))
|
||||
|
||||
return org_view(org, teams)
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ class TeamMemberList(ApiResource):
|
|||
}
|
||||
|
||||
if authentication.federated_service:
|
||||
if SuperUserPermission().can():
|
||||
if SuperUserPermission().can() and AdministerOrganizationPermission(orgname).can():
|
||||
data['can_sync'] = {
|
||||
'service': authentication.federated_service,
|
||||
}
|
||||
|
|
Reference in a new issue