Skip to content

Instantly share code, notes, and snippets.

@merk
Created March 26, 2011 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merk/887939 to your computer and use it in GitHub Desktop.
Save merk/887939 to your computer and use it in GitHub Desktop.
<?php
$oid = new ObjectIdentity('class', $this->threadClass);
$sid = UserSecurityIdentity::fromAccount($this->securityContext->getToken()->getUser());
foreach ($this->aclProvider->findAcl($oid)->getClassAces() AS $entry) {
if ($entry->getSecurityIdentity()->equals($sid)) {
var_dump($entry->getMask()); // Doesnt dump, The user has role ROLE_SUPERADMIN
}
}
$oid = new ObjectIdentity('class', $this->threadClass);
$sid = RoleSecurityIdentity('ROLE_SUPERADMIN');
foreach ($this->aclProvider->findAcl($oid)->getClassAces() AS $entry) {
if ($entry->getSecurityIdentity()->equals($sid)) {
var_dump($entry->getMask()); // Dumps
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment