Check this field's permissions to determine whether or not it may be
        shown.
422698
def check_permission(self, request):
        
        return all((permission.has_permission(request) for permission in self.permission_classes))
110663
public void checkPermission(Permission perm, AddOnModel addOnModel) throws IzouPermissionException {
        try {
            rootPermission.checkPermission(perm, addOnModel);
            //its root
            return;
        } catch (IzouPermissionException ignored) {
            //its just not root
        }
        standardCheck.stream()
                .filter(permissionModule -> permissionModule.canCheckPermission(perm))
                .forEach(permissionModule -> permissionModule.checkPermission(perm, addOnModel));
    }
256032
def has(*permissions, **kwargs):
    

    target = kwargs['target']

    kwargs['target'] = type_for(target)

    # TODO: Predicate evaluation?
    return target in filter_(*permissions, **kwargs)
424554
def has_permissions(self, object, group, operations):
        ''''''
        if self.is_superuser:
            return 1
        else:
            models = self.session.router
            # valid permissions
            query = models.permission.for_object(object, operation=operations)
            objects = models[models.role.permissions.model]
            return objects.filter(role=self.role.query(),
                                  permission=query).count()
732996
def check_read_permission(self, user_id, do_raise=True):
        
        if _is_admin(user_id):
            return True

        if int(self.created_by) == int(user_id):
            return True

        for owner in self.owners:
            if int(owner.user_id) == int(user_id):
                if owner.view == 'Y':
                    break
        else:
            if do_raise is True:
                raise PermissionError("Permission denied. User %s does not have read"
                             " access on network %s" %
                             (user_id, self.id))
            else:
                return False

        return True
571483
private boolean isRestricted(Permission permission) {
        for (Permission restrictedPermission : restrictablePermissions) {
            if (restrictedPermission.implies(permission)) {
                return true;
            }
        }
        return false;
    }
35187
def has_permission(self, user):
        
        return user.has_perm(
            self.model._meta.app_label + '.' + self.get_permission()
        )
139624
async def check_permission(bot: NoneBot, ctx: Context_T,
                           permission_required: int) -> bool:
    
    min_ctx_kwargs = {}
    for field in _min_context_fields:
        if field in ctx:
            min_ctx_kwargs[field] = ctx[field]
        else:
            min_ctx_kwargs[field] = None
    min_ctx = _MinContext(**min_ctx_kwargs)
    return await _check(bot, min_ctx, permission_required)
1132332
def has_permission(self, request):
        """"""
        if not self.object and not self.permission:
            return True

        if not self.permission:
            return request.user.has_perm('{}_{}'.format(
                self.model_permission,
                self.object.__class__.__name__.lower()), self.object
            )

        return request.user.has_perm(self.permission)
200973
def check_owner_permission(payload, allow_user_owner):
    """"""
    for entity_type in ['users', 'groups']:
        for perm_type in ['add', 'remove']:
            for perms in payload.get(entity_type, {}).get(perm_type, {}).values():
                if 'owner' in perms:
                    if entity_type == 'users' and allow_user_owner:
                        continue

                    if entity_type == 'groups':
                        raise exceptions.ParseError("Owner permission cannot be assigned to a group")

                    raise exceptions.PermissionDenied("Only owners can grant/revoke owner permission")
394815
def validate_with_permissions(self, val, caller_permissions):
        
        self.validate(val)
        self.validate_fields_only_with_permissions(val, caller_permissions)
        return val
137081
function canViewEmbed( )
    {
        if ( !isset( $this->Permissions["can_view_embed"] ) )
        {
            $this->Permissions["can_view_embed"] = $this->checkAccess( 'view_embed' );
        }
        return ( $this->Permissions["can_view_embed"] == 1 );
    }
440423
def is_public(self):
        """"""
        for grant in self._boto_object.Acl().grants:
            if 'AllUsers' in grant['Grantee'].get('URI', ''):
                if grant['Permission'] == 'READ':
                    return True

        return False
883381
def has_access(self, permission_name, view_name):
        
        if current_user.is_authenticated:
            return self._has_view_access(g.user, permission_name, view_name)
        elif current_user_jwt:
            return self._has_view_access(current_user_jwt, permission_name, view_name)
        else:
            return self.is_item_public(permission_name, view_name)
747635
def get_field_visibility_mode(self, field):
        
        fallback_mode = ("hidden", "hidden")
        widget = field.widget

        # TODO This needs to be done differently
        # Check where the field has to be located
        layout = widget.isVisible(self.context, "header_table")
        if layout in ["invisible", "hidden"]:
            return fallback_mode

        # Check permissions. We want to display field (either in view or edit
        # modes) only if the current user has enough privileges.
        if field.checkPermission("edit", self.context):
            mode = "edit"
            sm = getSecurityManager()
            if not sm.checkPermission(ModifyPortalContent, self.context):
                logger.warn("Permission '{}' granted for the edition of '{}', "
                            "but 'Modify portal content' not granted"
                            .format(field.write_permission, field.getName()))
        elif field.checkPermission("view", self.context):
            mode = "view"
        else:
            return fallback_mode

        # Check if the field needs to be displayed or not, even if the user has
        # the permissions for edit or view. This may depend on criteria other
        # than permissions (e.g. visibility depending on a setup setting, etc.)
        if widget.isVisible(self.context, mode, field=field) != "visible":
            if mode == "view":
                return fallback_mode
            # The field cannot be rendered in edit mode, but maybe can be
            # rendered in view mode.
            mode = "view"
            if widget.isVisible(self.context, mode, field=field) != "visible":
                return fallback_mode
        return (mode, layout)
972943
function checkPermissions (access: number, uid: number, gid: number, stat: Stat): boolean {
  return (access & resolveOwnership(uid, gid, stat)) === access;
}
683342
public function canView()
    {
        return (Director::isDev() || Director::is_cli() ||
            !$this->config()->get('check_permission') ||
            Permission::check($this->config()->get('check_permission'))
        );
    }