Only the primary on the account can add or remove user's access to an account
        :param account_id: int of the account_id for the account
        :param user_id:    int of the user_id to grant access
        :return:           Access dict
775755
def put(self, account_id, user_id):
        
        return self.connection.put('account/access', data=dict(account_id=account_id,           user_id=user_id))
979702
def shared_with_accounts= (account_id_list)
      already_sharing_with = self.shared_with_accounts

      accounts_to_add = account_id_list.select { |account_id| !already_sharing_with.include?(account_id) }

      # Note, using the network API, it is possible to "unshare" an image template
      # with the account that owns it, however, this leads to a rather odd state
      # where the image has allocated resources (that the account may be charged for)
      # but no way to delete those resources. For that reason this model
      # always includes the account ID that owns the image in the list of
      # accounts the image will be shared with.
      my_account_id = self['accountId']
      accounts_to_add.push(my_account_id) if !already_sharing_with.include?(my_account_id) && !accounts_to_add.include?(my_account_id)

      accounts_to_remove = already_sharing_with.select { |account_id| (account_id != my_account_id) && !account_id_list.include?(account_id) }

      accounts_to_add.each {|account_id| self.service.permitSharingAccess account_id }
      accounts_to_remove.each {|account_id| self.service.denySharingAccess account_id }
    end
297029
def authorize(self, ctx, identity, ops):
        '''
        '''
        allowed = []
        caveats = []
        for op in ops:
            ok, fcaveats = self._f(ctx, identity, op)
            allowed.append(ok)
            if fcaveats is not None:
                caveats.extend(fcaveats)
        return allowed, caveats
1016086
async def permits(self, identity, permission, context=None):
        
        # pylint: disable=unused-argument
        user = self.user_map.get(identity)
        if not user:
            return False
        return permission in user.permissions
879605
def get_by_id(self, acct_id) -> Account:
        
        return self.book.get(Account, guid=acct_id)
1322673
function access(permission, account, callback) {
  // User #1 has all privileges:
  if (account.uid === 1) {
    callback(null, true);
    return;
  }

  // If permissions is already loaded, use them.
  if (account.permissions) {
    callback(null, account.permissions.indexOf(permission) > -1);
    return;
  }

  role_permissions(account.roles, function (err, permissions) {
    if (err) {
      callback(err);
      return;
    }

    callback(null, permissions.indexOf(permission) > -1);
  });
}
1064838
def list_accounts_add(self, id, account_ids):
        
        id = self.__unpack_id(id)
        
        if not isinstance(account_ids, list):
            account_ids = [account_ids]
        account_ids = list(map(lambda x: self.__unpack_id(x), account_ids))
        
        params = self.__generate_params(locals(), ['id'])        
        self.__api_request('POST', '/api/v1/lists/{0}/accounts'.format(id), params)
1119768
def push_single_account(account, message_type, message, params = {})
      params.merge!({
        account: account,
        message_type: message_type,
        message: message
        })
      self.send_request('push','single_account',params)
    end
335579
def for_account_hash(parent, account_hash):
        
        account = AccountProxy(parent)
        account.account_hash = account_hash
        if account.acquire():
            return account
        return None
872358
def get_aggregate_by_id(self, account_id: str) -> AccountAggregate:
        
        account = self.get_by_id(account_id)
        return self.get_account_aggregate(account)
819244
def account(self, id):
        """"""
        if self.parser.has_section(id):
            return self._section_to_account(id)
        return None
1299789
def make_primary(self, user, identity):
        
        return UserIdentityRequest(self).put(self.endpoint.make_primary, user, identity)
191251
def grant_access(self, agreement_id, did, grantee_address, account):
        
        return self._keeper.access_secret_store_condition.fulfill(
            agreement_id, add_0x_prefix(did_to_id(did)), grantee_address, account
        )
445088
def Account(self):
		

		return(clc.v2.Account(alias=self.alias,session=self.session))
251132
def lock_account(self, identifier):
        
        locked_time = int(time.time() * 1000)  # milliseconds
        self.account_store.lock_account(identifier, locked_time)
1248112
@RequestMapping(value = "{accountId}", method = RequestMethod.DELETE)
    public Ack deleteAccount(@PathVariable ID accountId) {
        return accountService.deleteAccount(accountId);
    }
126
def unlock_account(account):
        
        return Web3Provider.get_web3().personal.unlockAccount(account.address, account.password)