W jaki sposób mogę nadać uprawnienia tylko dla edycji danej klasy, nie ważne co jest edytowane?
Przykładowo chcę nadać możliwość edycji dla przykładu: /admin/blog/3/edit
Zrobiłem to za pomocą:
// creating the ACL $aclProvider = $this->get('security.acl.provider'); $objectIdentity = ObjectIdentity::fromDomainObject($post); $acl = $aclProvider->createAcl($objectIdentity); // retrieving the security identity of the currently logged-in user $tokenStorage = $this->get('security.token_storage'); $user = $tokenStorage->getToken()->getUser(); $securityIdentity = UserSecurityIdentity::fromAccount($user); // grant owner access $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER); $aclProvider->updateAcl($acl);
Problem jest w tym że nadaje mi uprawnienie do edycji ale dla obiektu 3, a ja chciałbym aby uprawnienie dotyczyło wszystkich obiektów . Jak wejdę na obiekt inny niż 3 to już mnie wpuścić nie chce
Posługiwałem się tą dokumentacją: http://symfony.com/doc/current/cookbook/se...d-adding-an-ace