Closed Elfangor93 closed 1 year ago
\
$this->component->createAccess();
$acl = $this->component->getAccess();
$acl->setUser(<USERID>); // optional
$res = $acl->checkACL(<ACTION>,<ASSET>, <ID>);
dump($res);
Apply the the code from above as described in the first comment.
Prepare component and settings
Perform the test by reloading the maintenance view and check if the output is correct. false: permission denied true: permission accepted
Not directly related with feature test, but while uploading file to create test date I get an error:
Installed zip from acl-apply branch. @Elfangor93 please advise.
@szepty-ziemi You are right here are some major error which I have no clue where they come from. I created a new PR (#113) containing the same code changes as this one, but without messed up code ;-)
What is this service for
The Access service will be used to extend the default ACL logic of Joomla core in order to allow checks against inown and own access rules. Inown and own access rules are used in JoomGallery to manage ACL exceptions. For example, a user may perform a certain task within an asset of which he is the creator (owner), even if this task is generally forbidden for him.
How to use this service
You can load the service anywhere in Joomla by doing
The following actions are available:
add, admin, delete, edit, editstate, manage
The following assets are available:
image, category, tag, config
How to test the service
Make sure "Debug System" is "Yes" in Joomla Global configuration. Open the file
/administrator/com_joomgallery/src/View/Faulties/HtmlView.php
and insert the following code on line 62 afterthrow new \Exception(implode("\n", $errors)); }
Different test instructions see comments below...