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