How can I restrict the right "Restrict item visibility" at node add only for admin?

Comments

AlexisWilke’s picture

Who would have thought of that?! 8-)

That restriction is really only for the menu item visibility, not to actually prevent a role from reaching the destination.

Anyway, there isn't such a restriction at this point.

Do you only want the admin to have the right to edit that info? If so, we could easily check user_access() of a given role...

Thank you.
Alexis Wilke

Anonymous’s picture

I use the content_access module for different content-types/user roles and your module to hide different menu-items. If user-roles have the edit-right, they can edit the menu visibility. But I would like that this user-roles have only one menu-path to edit and not the right to influence this or edit another menu-path. Also I would like to prevent that a user of a role create a page with a menu-path that I not prefer. I know that your module not prevent a role from reaching a destination, but it comes my requirements at the nearest. (hope this is the right vocable)

> Do you only want the admin to have the right to edit that info?
Yes.
> If so, we could easily check user_access() of a given role...
How? My drupal programming know how is currently not so great. Could you give me a patch?

Thank you.
Frank Kunert

AlexisWilke’s picture

Version: 6.x-1.5 » 6.x-1.x-dev

Frank,

Okay, if you would please check the -dev version (available within 12h from now) and let me know what you think. It will hide the interface to anyone who does not have permission (who does not have the right role.)

Now, I guess we have a problem with having a default setup for each menu, possibly based on the node type... Let me know how this works for you at this point.

Thank you.
Alexis

Anonymous’s picture

Hello Alexis,

thank you for your fast help - the permission to edit the visibility is a nice feature.

> Now, I guess we have a problem with having a default setup for each menu, possibly based on the node type... Let me know how this works for you at this point.

The problem before and after the patch is that on the create content page | menu settings | parent item listbox, menu-names and -items to be available that I not prefer to offer my roles - e.g. navigation or primary menu. I can hide menu-items but not menu-names. The roles can use this menupath for new pages.
Another thing is that I have menus that the roles only should use, but not create pages with this menupath. Hide this menus is a no go way - a only read permission for that menus would be the soulution, but I think this is too complex.

Once again - thank you.
Frank

AlexisWilke’s picture

fku,

Hmmm... so is the current version working for you?

If not, what else would you need?

Now I know what I was thinking about when I was looking at the code and thought... something missing in this module. It was actually in another module: http://drupal.org/project/node_privacy_byrole

That other module has a default in the node_type as I think the menu_per_role should also have. That way, when hidden it can still get a correct default set of settings (when right now everything is going to be visible by default.)

Thank you.
Alexis

Anonymous’s picture

> Hmmm... so is the current version working for you?
Yes.
> If not, what else would you need?
See #4, if a role can only create pages for menupath that I, as admin, prefer - that would be a of great help for me and make my site safer.

Thank you.
Frank

AlexisWilke’s picture

fku,

Okay! I now understand #4.

The drop down selection should hide some of the menus based on the user roles. Right now, this is not part of of this module, but I guess that would make sense.

We'd have to add a role selection in the menu itself:

  admin/build/menu-customize/primary-links/edit

and others.

It's now on my TODO list.

Thank you.
Alexis

Anonymous’s picture

Thank you...
Frank

AlexisWilke’s picture

Title: Restrict the right "Restrict item visibility" » Restrict the list of menus a role can select (the dropdown)

Changing the title.

grimreaper’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Hello,

Closing as the issue is about a deprecated version of Drupal.