Hi,

Here's my usage scenario for this module: I have site with two roles, "admin" and "manager". The admin, of course, has nearly all authorization as user 1 to add or modify 100 pages on the website. However, the manager role has access to edit and delete only 10 specific pages or sections of the website- along with only 10 corresponding items in a custom menu.

The problem arises when I install the module and all menu items have no restrictions by default. Makes sense. But now I have to edit every menu item in Primary, Secondary, and Navigation links and change their role access. The goal is for the "manager" role to only deal with her own menu and not see anything esle.

Question: To aviod waisting precious time editing the role access on every menu item, where in the database can the role access values be found?

I'm thinking that I could come up (ask someone that knows) with a query that could change all menu items in the database. Something along the lines of:

For each 'field' in 'table' where 'field' = 'authenticated', update 'field' = 'admin'

This is probably oversimplification since I'm not a Mysql expert, but it may be a step in the right direction.

Your help and advice is greatly appreciated!

Alan.

Comments

AlexisWilke’s picture

The menu table is menu_links and it includes all the "mlid" that you need.

The menu_per_role table is where you need to add them.

The rids field in menu_per_role needs to be the comma separated list of all the roles who have access (i.e. administrator).

So something like this should work:

UPDATE menu_per_role (SELECT mlid, '3', '' FROM menu_links);

WARNING: I have not tested the statement and the '3' is the administrator role number which may be something else in your Drupal install!!!

Then you can go through the 10 or so menus that the admin can edit.

Thank you.
Alexis

aww’s picture

Thank you Alexis,

Actually, it's the manager that should have access to only 10 menu items.

I appreciate your help.

aww’s picture

Unfortunatelly, the restricted menu item still needs to be visible to all roles. So, in this instance, the manager role should view and access a node but not edit its menu link.

AlexisWilke’s picture

8-)

Yeah... I thought the front page of the module was clear enough...

This module is used to HIDE menu items. That's it.

To protect pages from editing you can:

1) Define a filter that the manager cannot use will block the manager from editing the nodes using that filter:

PRO: It's part of Core

CON: You're likely to make mistake (forget to turn it ON.)

2) Use tac_lite

PRO: The granularity is fantastic

CON: As with (1) you are likely to make a mistake, however you can force users to select a term and you can define the default term as one that blocks the managers.

3) Use tac_lite, tacle_rules and Rules

PRO: Automatic

CON: The Rules module is difficult to use and maintain.

4) Use node_privacy_byrole

In your case this may be the best solution. It protects your node and the default could be no rights except to the 2 users allowed to edit.

Thank you.
Alexis

aww’s picture

Hi Alexis,

Sorry I glased over your initial warning in the front page. It is clear enough, but sometimes us newbies will try anyting out of sheer determination to solve a problem, even if the outcome is panifully obvious.

My scenario is deceitfully simple: Of a given number of users, all can see nodes and their corresponding links. One poor user can see and access all nodes but can only edit her own set of nodes- here's the deal- she should not be able to see any of the other menus in the 'Menu Settings' of the node. Otherwise she could (and probably will) put the link in the wrong parent menu.

With your module I was hoping to hide the menu links that did not belong to her in the 'Menu Settings' drop-down field.

Anyway, I appreciate your help.

AlexisWilke’s picture

Aha!

Interesting idea. This module does not do that (yet.) Maybe someone could offer such a feature or a patch. I've not seen this anywhere so far.

This module only hides menus in the menu blocks and primary/secondary menus. Not the drop-down in the form.

If she's limited to editing only her nodes, I would think that just changing the settings in the Permissions would be enough.

Thank you.
Alexis

AlexisWilke’s picture

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

Marking this issue as version 6.x-1.x-dev since it is not really specific to 1.7.

Grimreaper’s picture

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

Hello,

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