Returns requested permissions declared within AOSP project.

        This includes several other permissions as well, which are in the platform apps.

        :rtype: list of str
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
739286
public static void getPermission(@NonNull Activity context, @NonNull String[] permissions, @NonNull Response response) {
        if (Build.VERSION.SDK_INT < 23) {
            response.permissionGranted();
        } else {

            HashSet<String> permissionSet = new HashSet<>();

            for (String permission : permissions)
                if (ContextCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {
                    permissionSet.add(permission);
                }

            if (permissionSet.size() > 0) {
                int id = 42167;
                while (map.containsKey(id))
                    id = random.nextInt(Short.MAX_VALUE * 2);

                map.put(id, new ResponseWrapper(response, permissions));

                context.requestPermissions(permissionSet.toArray(new String[permissionSet.size()]), id);
            } else {
                response.permissionGranted();
            }
        }
    }
893023
def get_permissions(self):
        
        path = Client.urls['all_permissions']
        conns = self._call(path, 'GET')
        return conns
447988
private static Map<String, Integer> permissions() {

        if (m_permissions == null) {
            LinkedHashMap<String, Integer> permissions = new LinkedHashMap<String, Integer>();
            permissions.put("GUI_PERMISSION_TYPE_READ_0", new Integer(CmsPermissionSet.PERMISSION_READ));
            permissions.put("GUI_PERMISSION_TYPE_WRITE_0", new Integer(CmsPermissionSet.PERMISSION_WRITE));
            permissions.put("GUI_PERMISSION_TYPE_VIEW_0", new Integer(CmsPermissionSet.PERMISSION_VIEW));
            permissions.put("GUI_PERMISSION_TYPE_CONTROL_0", new Integer(CmsPermissionSet.PERMISSION_CONTROL));
            permissions.put(
                "GUI_PERMISSION_TYPE_DIRECT_PUBLISH_0",
                new Integer(CmsPermissionSet.PERMISSION_DIRECT_PUBLISH));
            m_permissions = Collections.unmodifiableMap(permissions);
        }
        return m_permissions;
    }
36826
def request_permissions(self, permissions):
        
        f = self.create_future()

        #: Old versions of android did permissions at install time
        if self.api_level < 23:
            f.set_result({p: True for p in permissions})
            return f

        w = self.widget
        request_code = self._permission_code
        self._permission_code += 1  #: So next call has a unique code

        #: On first request, setup our listener, and request the permission
        if request_code == 0:
            w.setPermissionResultListener(w.getId())
            w.onRequestPermissionsResult.connect(self._on_permission_result)

        def on_results(code, perms, results):
            #: Check permissions
            f.set_result({p: r == Activity.PERMISSION_GRANTED
                          for (p, r) in zip(perms, results)})

        #: Save a reference
        self._permission_requests[request_code] = on_results

        #: Send out the request
        self.widget.requestPermissions(permissions, request_code)

        return f
631612
def get_required_permissions(self, request):
        
        perms = []

        if not self.permission_required:
            return perms

        if isinstance(self.permission_required, string_types):
            perms = [self.permission_required, ]
        elif isinstance(self.permission_required, Iterable):
            perms = [perm for perm in self.permission_required]
        else:
            raise ImproperlyConfigured(
                '\'PermissionRequiredMixin\' requires \'permission_required\' '
                'attribute to be set to \'<app_label>.<permission codename>\' but is set to {} '
                'instead'.format(self.permission_required)
            )
        return perms
1079892
def get_permission_checks(self, request, view):
        
        if view.action is None:
            return []
        # if permissions are defined for view directly - use them.
        if hasattr(view, view.action + '_permissions'):
            return getattr(view, view.action + '_permissions')
        # otherwise return view-level permissions + extra view permissions
        extra_permissions = getattr(view, view.action + 'extra_permissions', [])
        if request.method in SAFE_METHODS:
            return getattr(view, 'safe_methods_permissions', []) + extra_permissions
        else:
            return getattr(view, 'unsafe_methods_permissions', []) + extra_permissions
1313028
def check_permissions(self, request):
        

        for permission in self.get_permissions():
            if not permission.has_permission(request, self):
                self.permission_denied(request, message=getattr(permission, 'message', None))
960096
def _get_all_permissions(opts, tools):
    """"""
    perms = []
    for tool in tools:
        perms.append((_get_permission_codename(tool, opts), 'Can %s %s' % \
                (tool.name, opts.verbose_name_plural)))
    return perms
1358778
def get_project_ids(self):
        
        user = self.request.user
        projects = Project.objects.accessible_to(user).values('id')
        return [p['id'] for p in projects]
564015
def get_organism_permissions(self, group):
        
        data = {
            'name': group,
        }
        response = _fix_group(self.post('getOrganismPermissionsForGroup', data))
        return response
791917
def get_permissions(self):
        
        if not self.object_id:
            return []

        url = self.build_url(
            self._endpoints.get('permissions').format(id=self.object_id))

        response = self.con.get(url)
        if not response:
            return None

        data = response.json()

        # Everything received from cloud must be passed as self._cloud_data_key
        return [DriveItemPermission(parent=self, **{self._cloud_data_key: item})
                for item in data.get('value', [])]
944968
def object_permission_set(self):
        ''''''
        return Or(
            AllowOnlySafeHttpMethod,
            AllowAdmin,
            And(
                AllowPermission('org:admin'),
                ObjAttrTrue(lambda _, u: not u.is_superuser),
                ObjAttrTrue(
                    lambda r, _: r.data.get('admin') is not True)
            ),
            And(
                AllowModify,
                ObjAttrTrue(
                    lambda req, user: user == req.user),
                ObjAttrTrue(
                    lambda r, _: r.data.get('admin') is not True)
            ),
        )
261445
def get_permissions(self, virtual_host):
        
        virtual_host = quote(virtual_host, '')
        return self.http_client.get(API_VIRTUAL_HOSTS_PERMISSION %
                                    (
                                        virtual_host
                                    ))
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)
1139035
def check_model_permission(self, app, model):
        
        if self.apps_dict.get(app, False) and model in self.apps_dict[app]['models']:
            return True

        return False
454525
def get_group_permissions(self):
        
        if self._group_permissions is None:
            self._group_permissions = set()

            if self.settings.FIND_GROUP_PERMS:
                try:
                    self._load_group_permissions()
                except ldap.LDAPError as e:
                    results = ldap_error.send(self.backend.__class__,
                                              context='get_group_permissions',
                                              exception=e)
                    if len(results) == 0:
                        logger.warning("Caught LDAPError loading group permissions: %s",
                                       pprint.pformat(e))

        return self._group_permissions