How would you go about restricting a specific directory path to a role?
How do you restrict role access to the directory example1 so that example3 and 4 are restricted automatically?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
This depends on what that path is? Drupal has many kinds of paths and default permissions out of the box. If this was a Book hierarchy default permissions exist for books. The same for Taxonomy terms and other types of content. If this was a Views based path, you could configure Access rules in your view.
Drupal Roles are not a reliable way to deem access to content -- I would alter the
access callback for this path to use
user_access permission values and create a custom permission such as
view my custom site area and give that permission to desired roles. Then I would an
access arguments of
view my custom site area so the
user_access check works on those paths.
The Workbench Access module can do what you're asking if you define the Access rules using the
Menu Scheme and not Taxonomies, but this module only works for
Nodes last I checked.
Workbench Access provide the hierarchical permissions across "Sections" of your web site. You can use menus, taxonomy, or create your own hierarchical structure for controlling access to a piece of content.
A google search did the job:
The module will enable you to restrict access to certain paths per role. Each role has a page of either ACCESS ONLY or CANNOT ACCESS paths. Easy to set bunch permissions if you play with many roles at once.