public function hasPermissions()
{
$args = func_get_args();
if (func_num_args() < 1 || func_num_args() > 2) {
throw new \BadMethodCallException(sprintf("%s expects mandatory arguments. Usage: either " . "hasPermission(object \$obj, bool \$modify = null) or " . "hasPermission(int \$roleId, string \$permissionId = null)", __METHOD__));
}
if (is_object($args[0])) {
//Check Entity level permission
return $this->getContainer()->acl->hasAccessTo($args[0], $this->getUser(), $this->getEnvironment(), isset($args[1]) ? $args[1] : null);
} else {
//Check ACL
return $this->getContainer()->acl->isUserAllowedByEnvironment($this->getUser(), $this->getEnvironment(), $args[0], isset($args[1]) ? $args[1] : null);
}
}