New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to get permitions for section != 'component' #4198
Conversation
This will allow to set ACL different groups based on category permissions, for example: access.xml <section name="component"> [...] </section> <section name="category"> <action name="roles.list" title="roles list" description="" /> <action name="roles.manage" title="roles manage" description="" /> </section> view.html.php (view of a generic component) [...] $this->canDo = JHelperContent::getActions('com_componentname', 'category', $item->catid); if (!$this->canDo->get('roles.manage')) { JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); $app = JFactory::getApplication(); $app->redirect('index.php'); } [...]
@@ -116,7 +116,12 @@ public static function getActions($component = '', $section = '', $id = 0) | |||
$assetName = $component; | |||
} | |||
|
|||
$actions = JAccess::getActionsFromFile($path, "/access/section[@name='component']/"); | |||
if(empty($section)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a space here:
if (empty($section))
@test successful good catch. |
I did the changes you suggested. |
on line 123: https://github.com/joomla/joomla-cms/pull/4198/files#diff-70a9f5171aac5ecc71b5c63f03bdfee1R123 do you add two tabs that should be removed :D |
Done. Thank you. |
thanks @berlanda so we need on more test here 👍 |
Reverting PR joomla#4198 since it broke "Save to Copy" and "Save & New" buttons in com_content.
…a#4198 This will allow to set ACL different groups based on category permissions, for example: access.xml <section name="component"> [...] </section> <section name="category"> <action name="roles.list" title="roles list" description="" /> <action name="roles.manage" title="roles manage" description="" /> </section> view.html.php (view of a generic component) [...] $this->canDo = JHelperContent::getActions('com_componentname', 'category', $item->catid); if (!$this->canDo->get('roles.manage')) { JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); $app = JFactory::getApplication(); $app->redirect('index.php'); } [...] Update content.php Update content.php
Reverting PR joomla#4198 since it broke "Save to Copy" and "Save & New" buttons in com_content.
This will allow to set ACL different groups based on category permissions, for example:
access.xml
<section name="component">
[...]
</section>
<section name="category">
<action name="roles.list" title="roles list" description="" />
<action name="roles.manage" title="roles manage" description="" />
</section>
view.html.php (view of a generic component)
[...]
$this->canDo = JHelperContent::getActions('com_componentname', 'category', $item->catid);
if (!$this->canDo->get('roles.manage')) {
JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
$app = JFactory::getApplication();
$app->redirect('index.php');
}
[...]