Get a list of policy names from a role.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iam.list_role_policies myirole
978707
def list_role_policies(role_name, region=None, key=None, keyid=None,
                       profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        response = conn.list_role_policies(role_name)
        _list = response.list_role_policies_response.list_role_policies_result
        return _list.policy_names
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return []
601416
def get_domain_list(list_name):
    '''
    

    '''
    payload = {"jsonrpc": "2.0",
               "id": "ID0",
               "method": "get_policy_domain_names",
               "params": [list_name, 0, 256]}

    response = __proxy__['bluecoat_sslv.call'](payload, False)

    return _convert_to_list(response, 'item_name')
606977
function getUserRoles() {
    return [
      {name: 'User', role: 'user', settable: true},
      {name: 'Admin', role: 'admin', settable: true},
      {name: 'Root', role: 'root', settable: false}
    ];
  }
1368673
def get_user_roles(self):
        
        if self.is_anonymous_user():
            return []
        current_user = ploneapi.user.get_current()
        return ploneapi.user.get_roles(user=current_user)
681099
def list_policies_for_vhost(self, vhost):
        
        return self._api_get('/api/policies/{0}'.format(
            urllib.parse.quote_plus(vhost)
        ))
563368
def list_qos_policies(self, retrieve_all=True, **_params):
        """"""
        # Pass filters in "params" argument to do_request
        return self.list('policies', self.qos_policies_path,
                         retrieve_all, **_params)
1183538
def list_policies(vhost="/", runas=None):
    '''
    
    '''
    ret = {}
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'list_policies', '-q', '-p', vhost],
        reset_system_locale=False,
        runas=runas,
        python_shell=False)
    _check_response(res)
    output = res['stdout']

    if __grains__['os_family'] != 'FreeBSD':
        version = __salt__['pkg.version']('rabbitmq-server').split('-')[0]
    else:
        version = __salt__['pkg.version']('rabbitmq').split('-')[0]

    for line in _output_lines_to_list(output):
        parts = line.split('\t')

        if len(parts) not in (5, 6):
            continue

        vhost, name = parts[0], parts[1]
        if vhost not in ret:
            ret[vhost] = {}
        ret[vhost][name] = {}

        if _LooseVersion(version) >= _LooseVersion("3.7"):
            # in version 3.7 the position of apply_to and pattern has been
            # switched
            ret[vhost][name]['pattern'] = parts[2]
            ret[vhost][name]['apply_to'] = parts[3]
            ret[vhost][name]['definition'] = parts[4]
            ret[vhost][name]['priority'] = parts[5]
        else:
            # How many fields are there? - 'apply_to' was inserted in position
            # 2 at some point
            # and in version 3.7 the position of apply_to and pattern has been
            # switched
            offset = len(parts) - 5
            if len(parts) == 6:
                ret[vhost][name]['apply_to'] = parts[2]
            ret[vhost][name].update({
                'pattern': parts[offset+2],
                'definition': parts[offset+3],
                'priority': parts[offset+4]
            })

    return ret
985574
def listRoles(self, *args, **kwargs):
        

        return self._makeApiCall(self.funcinfo["listRoles"], *args, **kwargs)
963841
def list_policies(self, filters=None):
        
        _, policy_list = self.handler.streamed_request("list-policies",
                                                       "list-policy", filters)
        return policy_list
452665
def get_variables(self, variables=None):
        
        # Global policy variable expansion, we have to carry forward on
        # various filter/action local vocabularies. Where possible defer
        # by using a format string.
        #
        # See https://github.com/capitalone/cloud-custodian/issues/2330
        if not variables:
            variables = {}

        if 'mode' in self.data:
            if 'role' in self.data['mode'] and not self.data['mode']['role'].startswith("arn:aws"):
                self.data['mode']['role'] = "arn:aws:iam::%s:role/%s" % \
                                            (self.options.account_id, self.data['mode']['role'])

        variables.update({
            # standard runtime variables for interpolation
            'account': '{account}',
            'account_id': self.options.account_id,
            'region': self.options.region,
            # non-standard runtime variables from local filter/action vocabularies
            #
            # notify action
            'policy': self.data,
            'event': '{event}',
            # mark for op action
            'op': '{op}',
            'action_date': '{action_date}',
            # tag action pyformat-date handling
            'now': utils.FormatDate(datetime.utcnow()),
            # account increase limit action
            'service': '{service}',
            # s3 set logging action :-( see if we can revisit this one.
            'bucket_region': '{bucket_region}',
            'bucket_name': '{bucket_name}',
            'source_bucket_name': '{source_bucket_name}',
            'target_bucket_name': '{target_bucket_name}',
            'target_prefix': '{target_prefix}',
            'LoadBalancerName': '{LoadBalancerName}'
        })
        return variables
463829
def rbac_policy_list(request, **kwargs):
    """"""
    policies = neutronclient(request).list_rbac_policies(
        **kwargs).get('rbac_policies')
    return [RBACPolicy(p) for p in policies]
173962
def get_roles(self):
        

        machines = self.c_resources["machines"]
        result = {}
        for desc in machines:
            roles = utils.get_roles_as_list(desc)
            hosts = self._denormalize(desc)
            for role in roles:
                result.setdefault(role, [])
                result[role].extend(hosts)
        return result
973231
def _get_role_arn(name, **conn_params):
    '''
    
    '''
    if name.startswith('arn:aws:iam'):
        return name
    role = __salt__['boto_iam.describe_role'](name, **conn_params)
    rolearn = role.get('arn') if role else None

    return rolearn
204421
def raw_role_mentions(self):
        
        return [int(x) for x in re.findall(r'<@&([0-9]+)>', self.content)]
1335640
def policies(options = {})
      batches = Enumerator.new do |y|
        options = options.merge(role_name: @name)
        resp = @client.list_role_policies(options)
        resp.each_page do |page|
          batch = []
          page.data.policy_names.each do |p|
            batch << RolePolicy.new(
              role_name: @name,
              name: p,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      RolePolicy::Collection.new(batches)
    end
987611
def get_roles(server_context, container_path=None):
    
    url = server_context.build_url(security_controller, 'getRoles.api', container_path=container_path)
    return server_context.make_request(url, None)
163175
def role_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for role in kstone.roles.list():
        ret[role.name] = dict((value, getattr(role, value)) for value in dir(role)
                              if not value.startswith('_') and
                              isinstance(getattr(role, value), (six.string_types, dict, bool)))
    return ret