Remove a group's permissions to a specific object

@param string|array $permissions
@param mixed $object
@param Group\GroupInterface $group
337134
public function disallowGroup($permissions, $object, $group)
	{
		if(!is_array($permissions))
		{
			$permissions = array($permissions);
		}
		
		foreach($permissions as $permission)
		{
			$this->disallowSingleGroupPermission($permission, $object, $group);
		}
	}
873943
protected function removeSlug($alias, array $permissions)
    {
        $slugs = method_exists($this->permissions, 'pluck') ? $this->permissions->pluck('slug', 'name') : $this->permissions->lists('slug', 'name');
        $collection = new Collection($slugs);

        if ( $collection->has($alias) ) {
            $new = array_diff_key($collection->get($alias), array_flip($permissions));
            $collection->put($alias, $new);
        }

        return $collection->get($alias);
    }
443633
def delete_user_permissions(self, user, perm, obj, check_groups=False):
        
        user_perms = self.user_permissions(user, perm, obj, check_groups=False)
        if not user_perms.filter(object_id=obj.id):
            return
        perms = self.user_permissions(user, perm, obj).filter(object_id=obj.id)
        perms.delete()
907875
public function getUsers($permission, $object)
	{
		$permObject = $this->permission->findByPermissionAndObject($permission, $object);
		
		if(!$permObject)
			return array();
		
		return $this->userObjectPermission->findByObject($permObject, $object);
	}
707848
public function setPermissionsAttribute($permissions)
    {
        if (! ($permissions instanceof ChannelPermission)) {
            return;
        }

        list($allow, $deny) = $permissions->bitwise;
        $this->allow        = $allow;
        $this->deny         = $deny;

        $this->attributes['permissions'] = $permissions;
    }
243334
protected function userHasPermission(array $permissions)
    {
        if ( ! count($permissions)) {
            return true;
        }

        return (bool) count(
            array_filter($permissions, function ($permission) {
                return array_get($this->userPermissions, $permission);
            })
        );
    }
405872
public function grantAccess($object, UserInterface $user = null, $permission = Permissions::PERMISSIONS_VIEW, $new = true, $parent = null)
    {
        $objectIdentity = $this->getObjectIdentity($object);

        if (!$objectIdentity) {
            $this->logger->addDebug('could not create ObjectIdentity for object of class ' . get_class($objectIdentity));
        } else {
            $acl = $this->getAcl($objectIdentity, $new);

            // grant permission
            if (null === ($mask = $this->getMask($permission)) && !$parent) {
                $this->logger->addCritical('if permission is set to \'ignore\’ you have to pass in a parent object to inherit from');
                throw new \InvalidArgumentException('if permission is set to \'ignore\’ you have to pass in a parent object to inherit from');
            }

            if ($mask) {
                // if no user is given, get the one currently logged in
                if (!$user) {
                    $user = $this->sc->getToken()->getUser();
                }

                $securityIdentity = UserSecurityIdentity::fromAccount($user);
                $acl->insertObjectAce($securityIdentity, $mask);
            }

            // inherit?
            if ($parent && is_object($parent)) {
                $parentIdentity = $this->getObjectIdentity($parent);
                $parentAcl = $this->getAcl($parentIdentity, false);
                $acl->setParentAcl($parentAcl);
            }

            $this->aclProvider->updateAcl($acl);
            $this->logger->addDebug('updated acl for ' . get_class($object));
        }

        // cascade
        if ($object instanceof AclParent) {
            if ($objectIdentity) {
                $parent = $object;
            } elseif (!$parent) {
                // there's no parent to inherit from
                // and we can't create an object identity
                // for the current object
                // so we're not able to inherit from anything
                return true;
            }
            $this->logger->addDebug('cascading ACL to children of ' . get_class($parent));
            foreach ($object->getAclChildren() as $child) {
                if ($child) {
                    $this->grantInheritedAccess($child, $parent);
                }
            }
        }

        return true;
    }
1014724
public function beforePermission($permissions)
    {
        $permissions = is_array($permissions) ? $permissions : func_get_args();

        $this->beforeFilter(function () use ($permissions) {
            Trusty::filterByPermission($permissions);
        });
    }
696219
public function removeGroup(\Haven\SecurityBundle\Entity\Role $groups) {
        $this->groups->removeElement($groups);
    }
981395
private function getUserObjectPermissionByArray($permissions, UserInterface $user)
    {
        if (empty($permissions)) {
            return [];
        }

        $userPermission = [];
        $roles = $user->getRoleObjects();
        foreach ($roles as $role) {
            $roleId = $role->getId();
            if (!isset($permissions[$roleId])) {
                continue;
            }

            $userPermission = $this->cumulatePermissions($userPermission, $permissions[$roleId]);
        }

        return $userPermission;
    }
1279692
private function scheduleForDeletion($object)
    {
        $oid = spl_object_hash($object);
        if (isset($this->documentInsertions[$oid])) {
            if ($this->isInIdentityMap($object)) {
                $this->removeFromIdentityMap($object);
            }

            unset($this->documentInsertions[$oid], $this->documentStates[$oid]);

            return;
        }

        if (! $this->isInIdentityMap($object)) {
            return;
        }

        $this->removeFromIdentityMap($object);
        unset($this->documentUpdates[$oid]);

        $this->documentDeletions[$oid] = $object;
        $this->documentStates[$oid] = self::STATE_REMOVED;
    }
989138
public function setPermissions($permissions)
    {
        if (! is_array($permissions)) {
            $permissions = [$permissions];
        }

        $this->permissions = $permissions;

        return $this;
    }
1135247
public function remove(GroupInterface $group)
    {
        $this->em->remove($group);
        $this->em->flush();
        return true;

    }
649488
public function remove($object) : void
    {
        $hash = spl_object_hash($object);

        unset($this->objects[$hash]);
        unset($this->data[$hash]);
    }
1048090
public function remove($object)
    {
        // create property accessor
        $accessor = PropertyAccess::createPropertyAccessor();

        // delete existing documents with same id
        foreach ($this->index->find('id:' . $accessor->getValue($object, 'id')) as $hit) {
            $this->index->delete($hit->id);
        }
    }
441978
public function deleteServiceGroup($group)
    {
        $filename = $this->getConfigFilename($group);
        $this->getFilesystem()->remove($filename);

        // Unlike normal arrays, unset() will throw errors here if the key
        // doesn't exist.
        if (isset($this[$group])) {
            unset($this[$group]);
        }

        unset($this->removed[$group]);
    }
425877
public function setPermissionsAttribute(array $permissions)
	{
		// Merge permissions
		$permissions = array_merge($this->getPermissions(), $permissions);

		// Loop through and adjust permissions as needed
		foreach ($permissions as $permission => &$value)
		{
			// Lets make sure their is a valid permission value
			if ( ! in_array($value = (int) $value, $this->allowedPermissionsValues))
			{
				throw new \InvalidArgumentException("Invalid value [$value] for permission [$permission] given.");
			}

			// If the value is 0, delete it
			if ($value === 0)
			{
				unset($permissions[$permission]);
			}
		}

		$this->attributes['permissions'] = ( ! empty($permissions)) ? $permissions : '';
	}