Conversation
|
Haven't tested it yet but the idea is awesome! Note: We'll have to update the sample data after this has landed. |
|
I forgot something else. In order to install properly, in installation/sql/mysql/joomla.sql this line: INSERT INTO should be: INSERT INTO How do I add this to the pull request? Or should I make a new one? |
|
You can just add another commit to your branch, it will automatically be part of the pull request. Another note that just occured to me: We probably need a migration script for this. I'm pretty sure something weird will happen if there isn't an entry in the asset table for a menu or menu item. |
|
Thanks for the help. Regarding the migration script, when I was working on this, I started by just doing ALTER TABLE to add the asset_id column. Everything defaulted to 0 asset_id and nothing blew up. That might be enough. |
|
Created an update sql file containing Ran it and then tested on existing site saw some errors preventing the tmpl from displaying wen editing a menu item $canDo = $this->canDo; // error Also some errors with divs in views/item/tmpl/edit.php |
|
Alright, this latest commit should fix the problems that infograf768 saw. |
|
The above errors are now corrected. |
|
I fixed the permissions for new installations. For current installations you need to execute: UPDATE #__assets SET rules = '{"core.admin":{"7":1},"core.manage":{"6":1},"core.create":{"3":1},"core.delete":[],"core.edit":{"4":1},"core.edit.state":{"5":1},"core.edit.own":[]}' WHERE id = 16; |
|
@ test |
|
The only thing I can think of is that maybe the group and/or asset ids are different on your dataset. |
|
I am using default trunk install with sampledata, patched with your diff and both queries. |
|
@rmcdaniel great idea to add ACL support to menu's! Much requested feature among the users of Joomla ACL. Just started testing this new feature, and during the installation of fresh site with sampledata errors are visible while installing sampledata. The reason for this is that for example "installation/sql/mysql/sample_data.sq" should be updates as well with asset_id values for the #__menu and #__menu_types. Same for any other sample data file. In addition to this there should be references for all menu items and menus in the #__assets table as well. |
|
@sanderpotjer |
|
Thanks for the information. I'll try to get the sample data and the assets done today. As for the migration script, can you give me any ideas on how to start? Is there an example in the installation folder already? Any documentation? Another thing that someone with more experience could look at is how I implemented _getAssetParentId(). I think it might be supposed to return the menutype id, or maybe it should return the parent menu item if that exists? |
|
We do not have any migration script in present trunk. Just some simple updates to the db in com_admin. |
There was a problem hiding this comment.
The core.edit.own action is missing in the component section. So next line after core.edit.state should be core.edit.own
There was a problem hiding this comment.
That comes from upstream.
See: https://github.com/joomla/joomla-cms/blob/master/administrator/components/com_menus/access.xml
There was a problem hiding this comment.
That's because it doesn't make sense for the component wide access control we have now. However with the item level access you're adding it does make sense.
There was a problem hiding this comment.
Each action you add in additional access sections in an access.xml file should be available in the component access section. So the core.edit.own action is available in the menu section, and should be added to the component section as well. Otherwise you can't set an action component wide.
There was a problem hiding this comment.
Thanks, I understand now. Thanks for your help. I have added the needed line.
There was a problem hiding this comment.
Actually in content for example edit.own only applies at the category adn compoent level, you can't further specify it at the item level for performance and other reasons. You give edit own in a category and the user can edit everything belonging to her in the category.
|
Actually, the core.edit.own action is not needed in this component at the moment. There is no information stored in the menu tables about the creators of menutypes/menus. So it is better to remove the entire core.edit.own action for this component or we need to extend the menu tables with the creator information. |
|
Does that mean I should remove it from the menu section as well? |
There was a problem hiding this comment.
At the moment the menu types are stored in the assets table with a wrong parent id and level, to fix this add the following code over here to retrieve the correct information:
// This is a menutype that needs to parent with the extension.
if ($assetId === null)
{
// Build the query to get the asset id of the parent component.
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('id'));
$query->from($this->_db->quoteName('#__assets'));
$query->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote('com_menus'));
// Get the asset id from the database.
$this->_db->setQuery($query);
if ($result = $this->_db->loadResult())
{
$assetId = (int) $result;
}
}
|
@rmcdaniel yes that is correct to remove core.edit.own from the menu section as well. Sorry for the confusing btw, just noticed edit.own isn't possible at the moment, so better to remove it for now. |
|
Another thing I noticed, when installing new components an entry in the #__menu table is created for each of the backend menu items of the component (this is currently default in Joomla). Now with this new menu ACL an entry in the assets table is created as well, but missing the correct parent and level id's. This is more difficult to fix because there is no 'menutype' for the backend menu items. This might be solved if the backend menu will be transformed in a similar system as the frontend menus. I know there are plans for that, but don't know the status of that. So need to look into this (but want to share it already). |
There was a problem hiding this comment.
Add
<div class="clr"></div>
|
In what sense is there ownership in menus? You need to look at com_categories as that is the only core component that has a table extending jtablenested. That should show you how to work with nesting correctly. |
There was a problem hiding this comment.
The Rebuild button in the toolbar is now visible for users with access to the component but no edit/create/etc permissions. I suggest to show the button to users with core.admin permission, so it is in line with the com_categories for example. Line 68-72 of this file will become:
if ($canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::custom('menus.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false);
JToolBarHelper::preferences('com_menus');
}
There was a problem hiding this comment.
Agree, we need to look at all of those buttons if we are letting more
people into that ui.
On Sat, Jun 2, 2012 at 4:53 AM, Sander Potjer <
reply@reply.github.com
wrote:
@@ -51,7 +51,7 @@ protected function addToolbar()
{
require_once JPATH_COMPONENT.'/helpers/menus.php';
MenusHelper::getActions($this->state->get('filter.parent_id'));$canDo =$canDo = MenusHelper::getActions();JToolBarHelper::title(JText::_('COM_MENUS_VIEW_MENUS_TITLE'),
'menumgr.png');The Rebuild button in the toolbar is now visible for users with access to
the component but no edit/create/etc permissions. I suggest to show the
button to users with core.admin permission, so it is in line with the
com_categories for example. Line 68-72 of this file will become:if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::custom('menus.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false); JToolBarHelper::preferences('com_menus'); }
Reply to this email directly or view it on GitHub:
https://github.com/joomla/joomla-cms/pull/212/files#r918892
|
We'd really like to see this in Joomla 3.0 if not sooner. Please advise on what needs to be done in order to keep this alive. I've seen a lot of support for the idea so far. |
|
Is there any news on whether this will be included in a future Joomla version? Also (to me) the menu item management option doesn't seem to be working. I set the permissions of a menu item for Manager to Denied for all the actions. But a manager can still happily open, edit and save the item. He can even change his own permissions. |
|
1,2,3,4,5,6,7,8,9,10 As always the only "news" that matters is that from people who have tested Elin On Tue, Oct 2, 2012 at 5:35 AM, klah notifications@github.com wrote:
|
Let RIPS only run on the main repo
This adds ACL to the menu manager. Most of the code was copied from the content manager. I tried to follow all the conventions in the original code. I hope this helps!