|
@@ 83-85 (lines=3) @@
|
| 80 |
|
// check access for the route |
| 81 |
|
$resource = Acl::buildResourceName(Acl::GUARD_TYPE_ROUTE, $route->getPattern()); |
| 82 |
|
$privilege = Acl::getPrivilegeByHTTPMethod($request->getMethod()); |
| 83 |
|
if ($this->acl->hasResource($resource)) { |
| 84 |
|
$isAllowed = $isAllowed || $this->acl->isAllowed($user->role->name, $resource, $privilege); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
// check access for the callable |
| 88 |
|
$resource = Acl::buildResourceName(Acl::GUARD_TYPE_CALLABLE, $route->getCallable()); |
|
@@ 90-92 (lines=3) @@
|
| 87 |
|
// check access for the callable |
| 88 |
|
$resource = Acl::buildResourceName(Acl::GUARD_TYPE_CALLABLE, $route->getCallable()); |
| 89 |
|
$privilege = null; |
| 90 |
|
if ($this->acl->hasResource($resource)) { |
| 91 |
|
$isAllowed = $isAllowed || $this->acl->isAllowed($user->role->name, $resource, $privilege); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
if (!$isAllowed) { |
| 95 |
|
throw new JsonException(null, 403, 'Not allowed', 'Access to this location is not allowed'); |