How do I make the user page (/user/uid) of a particular role (PendingFreelancer) and the content they create not accessible/viewable to other users?
3 Answers
Content Access
This module allows you to manage permissions for content types by role and author. It allows you to specifiy custom view, edit and delete permissions for each content type. Optionally you can enable per content access settings, so you can customize the access for each content node.
I think content access is only for content type nodes. So for the user page umm.... I can't think of anything of the top of my head. I will edit this if I can think of something. Perhaps the only solution is doing it with a custom module programmatically.
If you use pathauto you could make so the user page path is user/[user:role]/[user:name]
then you could use
Path Access
Path_access provides the means to restrict pages based on their path alias - meaning you can lock out certain user role groups from whole sections of a site using wildcards.
and lock them out from certain [user:role] paths.
-
Had a look at Content Access. It restricts what content you can see based on your role, but not based on the role of the author of the content right?– p NgCommented Feb 3, 2016 at 10:06
-
Check out the Group module which help to build community based drupal sites.
The Group module allows you to create arbitrary collections of your content and users on your site and grant access control permissions on those collections
I believe Group works with any Drupal 7 entity.
If you are already using rules, then adding redirect rules for certain roles if they don't match the viewed user's role or a node's author's role would work.
Combine this with views filtering per role / block visibilities and panel varients per role would allow you to lock down a site pretty effectively.
I found that "content is viewed" rules add less than 10ms to a page load (or that's what rules debugging shows me). I think that's acceptable for the large majority of sites.