:param rights: list of rights. Possible values : 'sendAs',
        'sendOnBehalfOf'
        :return: dict with key ace with a list of rights
434246
def get_permissions(self, rights=[]):
        
        aces = []
        if rights:
            for right in rights:
                ace = self.request(
                    'GetPermission',
                    {'ace': {
                        'right': {'_content': right}}})

                if 'ace' in ace.keys() and isinstance(ace, list):
                    aces.extend(ace['ace'])
                elif 'ace' in ace.keys() and isinstance(ace, dict):
                    aces.append(ace['ace'])
            return {'ace': aces}

        else:
            ace = self.request('GetPermission', {})
            if 'ace' in ace.keys() and isinstance(ace['ace'], list):
                return ace
            elif 'ace' in ace.keys() and isinstance(ace['ace'], dict):
                return ace
            else:
                return {'ace': []}
162099
def rights_equal(rights_attr)
      f_rights = Array.wrap(fedora.fetch('rights', {}).fetch(rights_attr, [])).sort
      b_rights = Array.wrap(bendo.fetch('rights', {}).fetch(rights_attr, [])).sort

      return 0 if f_rights == b_rights
      1
    end
155793
def request_headers(self, request):
        
        headers = {}

        allow_origin = self.allow_origin(request)
        if allow_origin:
            headers = dict_filter({
                'Access-Control-Allow-Origin': allow_origin,
                'Access-Control-Allow-Credentials': {True: 'true', False: 'false'}.get(self.allow_credentials),
                'Access-Control-Expose-Headers': ', '.join(self.expose_headers) if self.expose_headers else None,
            })

        return headers
847336
def _addAccountRights(sidObject, user_right):
    '''
    
    '''
    try:
        if sidObject:
            _polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS)
            user_rights_list = [user_right]
            _ret = win32security.LsaAddAccountRights(_polHandle, sidObject, user_rights_list)
        return True
    # TODO: This needs to be more specific
    except Exception as e:
        log.exception('Error attempting to add account right, exception was %s',
                      e)
        return False
961887
def get_requested_aosp_permissions(self):
        
        aosp_permissions = []
        all_permissions = self.get_permissions()
        for perm in all_permissions:
            if perm in list(self.permission_module.keys()):
                aosp_permissions.append(perm)
        return aosp_permissions
904089
def permissions(self, perms):
        

        if not isinstance(perms, (list, tuple)):
            perms = [perms]

        instances = []

        for perm in perms:
            if isclass(perm):
                instances.append(perm())
            else:
                instances.append(perm)

        def decorator(func):
            func.permissions = instances
            return func
        return decorator
226594
def _headers(self, **kwargs):
        
        headers = BASE_HEADERS.copy()
        if self._token:
            headers['X-Plex-Token'] = self._token
        headers.update(kwargs)
        return headers
1219413
def _getRightsAssignments(user_right):
    '''
    
    '''
    sids = []
    polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS)
    sids = win32security.LsaEnumerateAccountsWithUserRight(polHandle, user_right)
    return sids
440501
def get_permissions(cls):
        
        perms = []
        for kls_name, kls in cls.registry.items():
            for method_name in cls.__dict__.keys():
                if method_name.endswith('_view'):
                    perms.append("%s.%s" % (kls_name, method_name))
        return perms
158716
def get_details_permissions(self):
        
        l = {}

        for i in self.permissions:
            if i in self.permission_module:
                x = self.permission_module[i]
                l[i] = [x["protectionLevel"], x["label"], x["description"]]
            else:
                # FIXME: the permission might be signature, if it is defined by the app itself!
                l[i] = ["normal", "Unknown permission from android reference",
                        "Unknown permission from android reference"]
        return l
648254
def list_user_permissions(self, name):
        
        return self._api_get('/api/users/{0}/permissions'.format(
            urllib.parse.quote_plus(name)
        ))
77606
def parse_permission_set(input):
    

    # Priority goes to the user's parsers.
    if isinstance(input, basestring):
        for func in current_acl_manager.permission_set_parsers:
            res = func(input)
            if res is not None:
                input = res
                break

    if isinstance(input, basestring):
        try:
            return current_acl_manager.permission_sets[input]
        except KeyError:
            raise ValueError('unknown permission set %r' % input)

    return input
1054386
def list_user_permissions(name, runas=None):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'list_user_permissions', name, '-q'],
        reset_system_locale=False,
        runas=runas,
        python_shell=False)

    return _output_to_dict(res)
271353
def file_rights(filepath, mode=None, uid=None, gid=None):
    '''
        
    '''
    file_handle = os.open(filepath, os.O_RDONLY)
    if mode:
        os.fchmod(file_handle, mode)
    if uid:
        if not gid:
            gid = 0
        os.fchown(file_handle, uid, gid)
    os.close(file_handle)
603110
def _delAccountRights(sidObject, user_right):
    '''
    
    '''
    try:
        _polHandle = win32security.LsaOpenPolicy(None, win32security.POLICY_ALL_ACCESS)
        user_rights_list = [user_right]
        _ret = win32security.LsaRemoveAccountRights(_polHandle, sidObject, False, user_rights_list)
        return True
    except Exception as e:
        log.exception('Error attempting to delete account right')
        return False
761366
def permissions(self):
        
        perms = set(super(DocumentWorkflow, self).permissions())
        if g:
            if hasattr(g, 'permissions'):
                perms.update(g.permissions or [])
            if hasattr(self.document, 'permissions'):
                perms = self.document.permissions(current_auth.actor, perms)
        return perms
354542
def getACLs(self, base, searchstr):
		
		acls = dict()
		res = self.query(base, searchstr, ['cn', 'ipHostNumber'])
		for dn,attr in res:
			cn = attr['cn'][0]
			dests = dict()
			if attr.has_key('ipHostNumber'):
				for entry in attr['ipHostNumber']:
					dest = entry.split('#', 1)[0].replace(" ", "")
					if len(entry.split('#', 1)) == 2:
						desc = entry.split('#', 1)[1].strip()
					else:
						desc = ""
					if not is_ip(dest):
						print dest, desc
						raise InputError(dest, "Invalid IP format")
					dests[dest] = desc
			acls[cn] = dests
		return acls