File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
contexts/ArticlePublishing/Infrastructure/Adapters Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 55namespace Contexts \ArticlePublishing \Infrastructure \Adapters ;
66
77use Contexts \ArticlePublishing \Domain \Gateway \AuthorizationGateway ;
8- use Contexts \Authorization \Domain \ Services \PolicyFactory ;
8+ use Contexts \Authorization \Contracts \ V1 \ Services \GlobalPermissionService ;
99
1010class AuthorizationAdapter implements AuthorizationGateway
1111{
1212 public function __construct (
13- private PolicyFactory $ policyFactory
13+ private GlobalPermissionService $ globalPermissionService ,
1414 ) {}
1515
1616 public function canPerformAction (string $ action ): bool
1717 {
18- $ policy = $ this ->policyFactory
19- ->forContext ('article_publishing ' )
20- ->action ($ action );
21-
22- return $ policy ->evaluate ();
18+ return $ this ->globalPermissionService ->checkPermission ('article_publishing ' , $ action );
2319 }
2420}
You can’t perform that action at this time.
0 commit comments