Removes a set of permissions applied on an object to a particular user/group

@param DataObject $node
@param type $perm
@param DataObject $to
@param type $grant
177339
public function removePermissions(DataObject $node, $perm, DataObject $userOrGroup, $grant = 'GRANT')
    {
        if (!$this->checkPerm($node, 'ChangePermissions')) {
            throw new PermissionDeniedException("You do not have permission to do that");
        }

        $composedOf = $perm;
        if (!is_array($perm)) {
            $role = DataObject::get_one('AccessRole', '"Title" = \'' . Convert::raw2sql($perm) . '\'');
            $composedOf = array($perm);
            if ($role && $role->exists()) {
                $composedOf = $role->Composes->getValues();
            }
        }
        
        $type = $userOrGroup instanceof Member ? 'Member' : get_class($userOrGroup);
        $filter = array(
            'Type' => $type,
            'AuthorityID' => $userOrGroup->ID,
            'ItemID' => $node->ID,
            'ItemType' => $node->class,
            'Grant' => $grant,
        );

        $existing = DataList::create('AccessAuthority')->filter($filter)->first();
        
        if (!$existing || !$existing->exists()) {
            return;
        }

        $current = $existing->Perms->getValues();
        if (is_array($current) && count($current)) {
            $new = array_diff($current, $composedOf);
            $existing->Perms = $new;
            $existing->write();
            
            $this->clearPermCacheFor($node);
            
            if (!count($new)) {
                try {
                    $this->removeAuthority($node, $existing);
                } catch (Exception $e) {
                    // oh well
                }
            }
        }
    }
260971
public function leaveNode(Node $node)
    {
        if ($node instanceof Stmt\Use_
            || $node instanceof Stmt\GroupUse
        ) {
            return false;
        }
    }
1217501
public function deleteByRange($from, $to)
    {
        DB::beginTransaction();
        try {
            $from = $from . ' 00:00:00';
            $to   = $to . ' 23:59:59';
            $logs = Logs::whereBetween('created_at', [$from, $to]);
            $logs->delete();
        } catch (Exception $ex) {
            Log::alert($ex);
            DB::rollback();
            return false;
        }
        DB::commit();
        return true;
    }
219714
def remove_perm(perm, user_or_group, forum=None):
    
    user, group = get_identity(user_or_group)
    perm = ForumPermission.objects.get(codename=perm)
    if user:
        UserForumPermission.objects.filter(
            forum=forum,
            permission=perm,
            user=user if not user.is_anonymous else None,
            anonymous_user=user.is_anonymous,
        ).delete()
    if group:
        GroupForumPermission.objects.filter(forum=forum, permission=perm, group=group).delete()
6627
public void deleteProjectPermission(DbSession dbSession, int userId, String permission, long projectId) {
    mapper(dbSession).deleteProjectPermission(userId, permission, projectId);
  }
1121480
public function removePermission(ChildPermission $permission)
    {
        if ($this->getPermissions()->contains($permission)) { $rolePermission = new ChildRolePermission();

            $rolePermission->setPermission($permission);
            if ($permission->isRolesLoaded()) {
                //remove the back reference if available
                $permission->getRoles()->removeObject($this);
            }

            $rolePermission->setRole($this);
            $this->removeRolePermission(clone $rolePermission);
            $rolePermission->clear();

            $this->collPermissions->remove($this->collPermissions->search($permission));

            if (null === $this->permissionsScheduledForDeletion) {
                $this->permissionsScheduledForDeletion = clone $this->collPermissions;
                $this->permissionsScheduledForDeletion->clear();
            }

            $this->permissionsScheduledForDeletion->push($permission);
        }


        return $this;
    }
197247
public function removePermission(
        UUID $uuid,
        Permission $permission
    ) {
        if (in_array($permission, $this->permissions)) {
            $this->apply(new PermissionRemoved($uuid, $permission));
        }
    }
213242
public function removeAuthority(DataObject $node, DataObject $authority)
    {
        if (!$this->checkPerm($node, 'DeletePermissions')) {
            throw new PermissionDeniedException("You do not have permission to do that");
        }

        if ($authority) {
            $authority->delete();
        }
        
        return $node;
    }
739275
public function deny($requester, $controlled, $perms = "*") {
		$permission = $this->_classes['permission'];
		return $permission::allow($requester, $controlled, $perms, -1);
	}
626733
public function checkPublicPerms(DataObject $node, $perm)
    {
        if ($perm == 'View') {
            if ($node->PublicAccess) {
                return true;
            }

            if ($node->InheritPerms) {
                $permParents = $this->getEffectiveParents($node);
                if (count($permParents) || $permParents instanceof IteratorAggregate) {
                    foreach ($permParents as $permParent) {
                        if ($permParent && $this->checkPublicPerms($permParent, $perm)) {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
1004170
private function deleteNode( $node ) {
		$this->deleteChildren( $node );
		$parent = $node->parentNode;
		$oldnode = $parent->removeChild( $node );
	}
954709
@Override
    public java.util.concurrent.Future<RemovePermissionResult> removePermissionAsync(String topicArn, String label) {

        return removePermissionAsync(new RemovePermissionRequest().withTopicArn(topicArn).withLabel(label));
    }
271335
def delete_perm(perm_id,**kwargs):
    

    #check_perm(kwargs.get('user_id'), 'edit_perm')
    try:
        perm_i = db.DBSession.query(Perm).filter(Perm.id==perm_id).one()
        db.DBSession.delete(perm_i)
    except InvalidRequestError:
        raise ResourceNotFoundError("Permission (id=%s) does not exist"%(perm_id))

    return 'OK'
52759
public function deletePermissionForUser($user, ...$permission)
    {
        $params = [];

        $params[] = $user;
        foreach ($permission as $perm) {
            $params[] = $perm;
        }

        return $this->removePolicy(...$params);
    }
730259
public function check($requester, $request, $perms) {
		$permission = $this->_classes['permission'];
		return $permission::check($requester, $request, $perms);
	}
554188
def has_group_perms(self, perm, obj, approved):
        
        if not self.group:
            return False

        if self.use_smart_cache:
            content_type_pk = Permission.objects.get_content_type(obj).pk

            def _group_has_perms(cached_perms):
                # Check to see if the permission is in the cache.
                return cached_perms.get((
                    obj.pk,
                    content_type_pk,
                    perm,
                    approved,
                ))

            # Check to see if the permission is in the cache.
            return _group_has_perms(self._group_perm_cache)

        # Actually hit the DB, no smart cache used.
        return Permission.objects.group_permissions(
            self.group,
            perm, obj,
            approved,
        ).filter(
            object_id=obj.pk,
        ).exists()
268609
def remove_perm(perm, group):
    
    if not isinstance(perm, Permission):
        try:
            app_label, codename = perm.split('.', 1)
        except ValueError:
            raise ValueError("For global permissions, first argument must be in"
                             " format: 'app_label.codename' (is %r)" % perm)
        perm = Permission.objects.get(content_type__app_label=app_label, codename=codename)

    group.permissions.remove(perm)
    return