Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7163043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:50:05+00:00 2026-05-28T13:50:05+00:00

I have a problem with the ACLs : I use a class scope to

  • 0

I have a problem with the ACLs :

I use a class scope to grant permissions on Role.

This is my code to declare the ClassAce :

$objectIdentity = new \Symfony\Component\Security\Acl\Domain\ObjectIdentity('class', 'Complete\\Class\\Name');
try
{
   $acl = $aclProvider->findAcl($objectIdentity);
}
catch (\Symfony\Component\Security\Acl\Exception\Exception $e)
{
   $acl = $aclProvider->createAcl($objectIdentity);
}
// retrieving the security identity of the currently role
$securityIdentity = new \Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity($role);
// grant owner access
$acl->insertClassAce($securityIdentity, \Symfony\Component\Security\Acl\Permission\MaskBuilder::MASK_OWNER);
$aclProvider->updateAcl($acl);

And this is my code to check access :

$securityContext = $this->get('security.context');
$oid = new \Symfony\Component\Security\Acl\Domain\ObjectIdentity('class', 'Complete\\Class\\Name');
if (false === $securityContext->isGranted('EDIT', $oid))
{
   throw new \Symfony\Component\Security\Core\Exception\AccessDeniedException();
}

I receive an AccessDeniedExeption, with the message in the logs : “No
ACL found for the object identity. Voting to deny access.”

I can resolve this by changing the equals function of the
RoleSecurityIdentity

The original function is

public function equals(SecurityIdentityInterface $sid)
{
   if (!$sid instanceof RoleSecurityIdentity) {
       return false;
   }

   return $this->role === $sid->getRole();
}

But if I change it by

public function equals(SecurityIdentityInterface $sid)
{
   if (!$sid instanceof RoleSecurityIdentity) {
       return false;
   }

   return $this->role == $sid->getRole();
}

It works…

I use my Own Role Class, could it be a problem ?

Thanks for your answers,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:50:05+00:00Added an answer on May 28, 2026 at 1:50 pm

    I had the similar problem. Extending Symfony\Component\Security\Core\Role\Role in my own Role class solved the problem.

    use Symfony\Component\Security\Core\Role\Role as CoreRole;
    
    class Role extends CoreRole{ // or extends CoreRole implements RoleInterface
    // my custom Role class
    }
    

    Find out what types of value are checking in equal function, it has to be string, not object. In my case it was role object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem to make work a resource file. This is my simple code
I have problem with this code..I want to extract data from flat file and
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem with code. I have written a function for extracting a parameter,
Have problem while getting data from Memcached on .NET MVC solution. I have this
I have problem with php's preg_match.I want to make something like this : When
i have problem with enum I need make a enum in base class or
I have problem with my code. I don't know what am I doing wrong.
I have problem with this method in NLog library: NLog.Targets.Wrappers.AsyncTargetWrapper.ProcessPendingEvents(object state) It consume too

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.