-
- 105 Posts
Revo 2.1.0
I’ve tried adding a permission to the Components menu by adding a comma and then my custom permission.
So when I go to: System->Actions Then right-click Components and then click Update Menu
My Permissions field looks like this: components,my_custom_permission
I got how to do that from this post.
http://modxcms.com/forums/index.php/topic,51622.0.html
My question is, does the comma mean OR or does it mean AND. So does the user have to have both permissions to view it or just one? Because from what I could tell, it means that they must have both permissions.
Is there a different character to put that will be interpreted as OR?
You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx.
Carpet Cleaning
-
- 24,544 Posts
That’s a really good question. I tested this a long time ago, and IRRC it’s AND (the only option). The user must have all permissions listed. I could be wrong. I’d love to know for sure that the user needs all permissions and I don’t have time to test it right now.
Since you can give any user any permission, it should be easy enough to do what you want with the AND requirement and it makes it easier to be sure you’re hiding menu items from specific users.
BTW, I’m working on a tutorial for this right now. In the latest version of MODX, you need to create a new policy template just for the custom permissions(s) (containing those permissions). Then create a policy based on that template and a Context Access ACL entry for the Administrator group with a context of mgr, a minimum role of Super User, and the policy you created. That will give the admin rights to the menu items with that permission and hide it from everyone else.
-
- 105 Posts
That’s what I thought.
I just wanted to hide all the other menu items without having to add a permission setting to all the items, but instead just add the one custom setting to Components. That way I can just assign the custom setting to whatever I want to the user to see. Oh well. Will make it work.
You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx.
Carpet Cleaning
-
- 24,544 Posts
Remember that if you hide a main Top Menu option, all the ones under it will be hidden automatically.
One way to go would be to duplicate selected menu items to create a new custom menu for the users, then hide all the original Top Menu items from them -- effectively hiding the entire original Top Menu.
Unfortunately, there’s no easy way to duplicate menu items at this time, you have to create new ones, then manually fill all the fields. I put in a feature request for a "duplicate" option.
-
- 535 Posts
hello, any advice how to create a permission to disallow access to a component for a user or a group of user ?
for example, i have Ditsnews and Gallery in my topmenu "component" but i dont want my client to have access to Ditsnews..
i understand where to put my permission but i doesnt understand how to write my permission...
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save
-
- 535 Posts
Ok i solved just now the problem.
i didn't understood that i could freely create a permission with the name a want in a new policy, then adding this policy to the context access of the group it will add to the others..
that's crazy freedom..
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save
-
- 24,544 Posts
Quote from: emmanuel at Dec 07, 2011, 09:29 AMOk i solved just now the problem.
i didn't understood that i could freely create a permission with the name a want in a new policy, then adding this policy to the context access of the group it will add to the others..
that's crazy freedom..
That's MODX.
-
- 572 Posts
Could someone explain how to do this please, i've searched for tutorials but have not found any as yet.
Thanks
J
www.9thwave.co.uk
WEB | DESIGN | PRINT