mixcoatl/admin/user.py
def grant(self, account_id, groups, billing_codes):
        """Grants the user access to the specified account. :attr:`reason`

        :param account_id: Account ID of the account to grant access.
        :type account_id: int.
        :param groups: List of group ID the user will belong to.
        :type groups: list.
        :param billing_codes: List of billing code the user will use.
        :type billing_codes: list.
        :returns: bool -- Result of API call
        """
        p = '%s/%s' % (self.PATH, str(self.user_id))

        group_list = []
        billing_code_list = []
        for group in groups:
            group_list.append({"groupId": group})
        for billing_code in billing_codes:
            billing_code_list.append({"billingCodeId": billing_code})

        payload = {"grant": [{"account": {"accountId": account_id},
                              "groups": group_list,
                              "billingCodes": billing_code_list}]}

        return self.put(p, data=json.dumps(payload))
Grants the user access to the specified account. :attr:`reason`

        :param account_id: Account ID of the account to grant access.
        :type account_id: int.
        :param groups: List of group ID the user will belong to.
        :type groups: list.
        :param billing_codes: List of billing code the user will use.
        :type billing_codes: list.
        :returns: bool -- Result of API call
        
Grants the user access to the specified account. :attr:`reason`
Grants the user access to the specified account . : attr : ` reason `
def grant(self, account_id, groups, billing_codes):
        p = '%s/%s' % (self.PATH, str(self.user_id))
        group_list = []
        billing_code_list = []
        for group in groups:
            group_list.append({"groupId": group})
        for billing_code in billing_codes:
            billing_code_list.append({"billingCodeId": billing_code})
        payload = {"grant": [{"account": {"accountId": account_id},
                              "groups": group_list,
                              "billingCodes": billing_code_list}]}
        return self.put(p, data=json.dumps(payload))
def grant ( self , account_id , groups , billing_codes ) : p = '%s/%s' % ( self . PATH , str ( self . user_id ) ) group_list = [ ] billing_code_list = [ ] for group in groups : group_list . append ( { "groupId" : group } ) for billing_code in billing_codes : billing_code_list . append ( { "billingCodeId" : billing_code } ) payload = { "grant" : [ { "account" : { "accountId" : account_id } , "groups" : group_list , "billingCodes" : billing_code_list } ] } return self . put ( p , data = json . dumps ( payload ) )
Grants the user access to the specified account.
Grants the user access to the specified account .
"""Grants the user access to the specified account. :attr:`reason`

        :param account_id: Account ID of the account to grant access.
        :type account_id: int.
        :param groups: List of group ID the user will belong to.
        :type groups: list.
        :param billing_codes: List of billing code the user will use.
        :type billing_codes: list.
        :returns: bool -- Result of API call
        """
- Result of API call
- Result of API call
self
account_id
Account ID of the account to grant access.
Account ID of the account to grant access .
groups
List of group ID the user will belong to.
List of group ID the user will belong to .
billing_codes
List of billing code the user will use.
List of billing code the user will use .