huskar_api/api/auth.py
def post(self, team_name):
        """Grants an user to the admin of specified team.

        :param team_name: The name of specified team.
        :form username: The username of granting user.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 400: The granting user is not found.
        :status 404: The team with specified name is not found.
        :status 200: The user is admin of this team already.
        :status 201: The user is granted successfully.
        """
        g.auth.require_admin('only huskar admin can add team admin')

        user_name = request.form['username'].strip()
        team = self._get_team_or_404(team_name)
        user = self._get_user_or_400(user_name)

        if team.check_auth(Authority.WRITE, user.id):
            return api_response()
        with audit_log(audit_log.types.GRANT_TEAM_ADMIN,
                       user=user, team=team):
            team.grant_admin(user.id)
        return api_response(), 201
Grants an user to the admin of specified team.

        :param team_name: The name of specified team.
        :form username: The username of granting user.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 400: The granting user is not found.
        :status 404: The team with specified name is not found.
        :status 200: The user is admin of this team already.
        :status 201: The user is granted successfully.
        
Grants an user to the admin of specified team.
Grants an user to the admin of specified team .
def post(self, team_name):
        g.auth.require_admin('only huskar admin can add team admin')
        user_name = request.form['username'].strip()
        team = self._get_team_or_404(team_name)
        user = self._get_user_or_400(user_name)
        if team.check_auth(Authority.WRITE, user.id):
            return api_response()
        with audit_log(audit_log.types.GRANT_TEAM_ADMIN,
                       user=user, team=team):
            team.grant_admin(user.id)
        return api_response(), 201
def post ( self , team_name ) : g . auth . require_admin ( 'only huskar admin can add team admin' ) user_name = request . form [ 'username' ] . strip ( ) team = self . _get_team_or_404 ( team_name ) user = self . _get_user_or_400 ( user_name ) if team . check_auth ( Authority . WRITE , user . id ) : return api_response ( ) with audit_log ( audit_log . types . GRANT_TEAM_ADMIN , user = user , team = team ) : team . grant_admin ( user . id ) return api_response ( ) , 201
Grants an user to the admin of specified team.
Grants an user to the admin of specified team .
"""Grants an user to the admin of specified team.

        :param team_name: The name of specified team.
        :form username: The username of granting user.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 400: The granting user is not found.
        :status 404: The team with specified name is not found.
        :status 200: The user is admin of this team already.
        :status 201: The user is granted successfully.
        """
self
team_name
The name of specified team.
The name of specified team .
form
The username of granting user.
The username of granting user .
<header
Huskar Token (See :ref:`token`)
Huskar Token ( See : ref : ` token ` )
status
The granting user is not found.
The granting user is not found .
status
The team with specified name is not found.
The team with specified name is not found .
status
The user is admin of this team already.
The user is admin of this team already .
status
The user is granted successfully.
The user is granted successfully .