Resets admin rights on a collection.

@param \ACL        $acl
@param \collection $collection
778226
private function doResetRightsOnCollection(\ACL $acl, \collection $collection)
    {
        $baseId = $collection->get_base_id();

        $acl->set_limits($baseId, false);
        $acl->remove_quotas_on_base($baseId);
        $acl->set_masks_on_base($baseId, '0', '0', '0', '0');
        $acl->update_rights_to_base(
            $baseId,
            [
                'creationdate'      => '1',         // todo : wtf
                \ACL::CANPUTINALBUM      => true,
                \ACL::CANDWNLDHD         => true,
                \ACL::NOWATERMARK        => true,
                \ACL::CANDWNLDPREVIEW    => true,
                \ACL::CANCMD             => true,
                \ACL::CANADMIN           => true,
                \ACL::CANREPORT          => true,
                \ACL::CANPUSH            => true,
                \ACL::CANADDRECORD       => true,
                \ACL::CANMODIFRECORD     => true,
                \ACL::CANDELETERECORD    => true,
                \ACL::CHGSTATUS          => true,
                \ACL::IMGTOOLS           => true,
                \ACL::COLL_MANAGE        => true,
                \ACL::COLL_MODIFY_STRUCT => true,
                \ACL::BAS_MODIFY_STRUCT  => true
            ]
        );
    }
1281935
public function setCollection(\collection $collection = null)
    {
        if ($collection === null) {
            $this->baseId = null;

            return;
        }
        $this->baseId = $collection->get_base_id();
    }
1024514
public function grantPermissions($permissions): void
    {
        if (!is_array($permissions) && !$permissions instanceof Collection) {
            $permissions = func_get_args();
        }

        foreach ($permissions as $permission) {
            $permission = $this->resolvePermission($permission);

            $permission->assignTo($this);
        }
    }
358943
public function resetAdminRights()
    {
        /** @var ACLManipulator $aclManipulator */
        $aclManipulator = $this->app['manipulator.acl'];
        $aclManipulator->resetAdminRights($this->getUserRepository()->findAdmins());

        return $this->app->redirectPath('admin_dashboard');
    }
447450
public function insureACL($key, $acl) {
		if(!$this->client) {
			throw new InvalidStorageSettingsException('Storage settings are invalid');
		}

		try {
			$this->client->putObjectAcl(['Bucket' => $this->bucket, 'Key' => $key, 'ACL' => $acl]);
		} catch (AwsException $ex) {
			throw new StorageException($ex->getMessage(), $ex->getStatusCode(), $ex);
		}
	}
265892
protected function reset()
    {
        $this->action     = null;
        $this->collection = null;
        $this->ident      = null;
    }
569377
public function resetAdminRights($users)
    {
        foreach ($this->makeTraversable($users) as $user) {
            $this->doResetAdminRights($user);
        }
    }
561338
public function filterModelCollectionAsContainer(Collection $collection)
    {
        parent::filterModelCollectionAsContainer($collection);

        $collection->filter(new Equals("Accepted", false));
    }
1091225
private function trackCollection(Collection $collection)
    {
        $blocks = $collection->getBlocks();
        $this->trackBlocks($collection, $blocks);

        $attributes = $collection->getSetCollectionAttributes();
        $this->trackAttributes($collection, $attributes);
    }
875352
protected function configureRoutes(RouteCollection $collection)
    {
        parent::configureRoutes($collection);

        $collection->add('moveUp', $this->getRouterIdParameter() . '/move-up');
        $collection->add('moveDown', $this->getRouterIdParameter() . '/move-down');
    }
44310
protected function configureRoutes(\Sonata\AdminBundle\Route\RouteCollection $collection)
    {
        parent::configureRoutes($collection);

        $collection->clearExcept(array('create', 'edit', 'delete'));
    }
193285
protected function configureRoutes(RouteCollection $collection)
    {
        parent::configureRoutes($collection);
        if (!$this->getAllowToAdd()) {
            $collection->remove('create');
        }
    }
1316390
private function updateAceIdentityMap(AclInterface $acl)
    {
        foreach (array('classAces', 'classFieldAces', 'objectAces', 'objectFieldAces') as $property) {
            $reflection = new \ReflectionProperty($acl, $property);
            $reflection->setAccessible(true);
            $value = $reflection->getValue($acl);

            if ('classAces' === $property || 'objectAces' === $property) {
                $this->doUpdateAceIdentityMap($value);
            } else {
                foreach ($value as $field => $aces) {
                    $this->doUpdateAceIdentityMap($value[$field]);
                }
            }

            $reflection->setValue($acl, $value);
            $reflection->setAccessible(false);
        }
    }
1348301
public function scheduleCollectionDeletion(PersistentCollection $coll)
    {
        $coid = spl_object_hash($coll);

        // TODO: if $coll is already scheduled for recreation ... what to do?
        // Just remove $coll from the scheduled recreations?
        if (isset($this->collectionUpdates[$coid])) {
            unset($this->collectionUpdates[$coid]);
        }

        $this->collectionDeletions[$coid] = $coll;
    }
846551
public void setACL(ACL acl){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.SetACL);

        SetACLProtocol p = new SetACLProtocol(acl);

        connection.submitRequest(header, p, null);
    }
920680
public function deleteRegistrationsOnCollection(\collection $collection)
    {
        $qb = $this->repository->createQueryBuilder('d');
        $qb->delete('Phraseanet:Registration', 'd');
        $qb->where($qb->expr()->eq('d.baseId', ':base'));
        $qb->setParameter(':base', $collection->get_base_id());
        $qb->getQuery()->execute();
    }
870424
private function assignPermissions(Collection $permissions) {
        $roles = Role::whereIn('id', $this->role_ids)->get();

        if ($roles && $permissions) {
            $permission_ids = $permissions->lists('id')->all();

            foreach ($roles as $role) {
                $role->permissions()->attach($permission_ids);
            }
        }
    }