By eeyorr on
I'm wondering if anyone has implemented something like this.
I have 2 roles: staff and student
I'm using the Bio module to replace user profiles with the biography content type. What I'd like to do is make staff biographies viewable for everyone and student bio's only viewable to authenticated users.
Does anyone have any ideas about this? I'd like to do it without writing a module (or rewriting something like Taxonomy Access) if it's possible. Thanks for any insight.
Comments
Would Content Access module work?
Would Content Access module work? I haven't experimented very much with access control modules, but this one seems like it fits your description.
-- David
absolutecross.com
[new guide/lesson in progress: Creating a CCK and Views powered Drupal site - feedback welcome]
Thanks for the suggestion.
Thanks for the suggestion. I could use it in a pinch, but I'd like for access control to be automatic based on the author's role. I don't have much experience with Content Access, but I think the bio pages would have to be manually tweaked each time they are created.
www.drupalmuseum.com
www.organicsitedesign.com
Ok I see.. Besides maybe
Ok I see..
Besides maybe Taxonomy Access as you're discussing below, my other idea is to consider using Node Profile instead of Bio (or Content Profile if you are thinking about upgrading to D6), since you could then have 2 separate CCK types for bio pages, and restrict the student type with Content Access. That would seemingly automate things on the front end, though would be a little more work for you initially (switching to Node Profile, and syncing two profile node templates).
-- David
absolutecross.com
[new guide/lesson in progress: Creating a CCK and Views powered Drupal site - feedback welcome]
VIEWS module
Hi,
Have you ever try out VIEWS module? I think you simply achieve this by using VIEWS module.
You can download and enable the module, and create a new view and by filtering it to the authenticated user, or other role you like.
I'm not sure this could helps you...
Best regards,
kailoon
But that would only create
But that would only create views of nodes that are accessible to the user. So if the user doesn't have permission to see the bio, he/she will not see the view and vice versa. It wouldn't change the individual node's access. I need to be able to grant or deny permission to view the nodes. Thanks for the input, though.
www.drupalmuseum.com
www.organicsitedesign.com
Your view would display in a
Your view would display in a block, and blocks can have php code attached that controls the display of content in that block based on role. Many examples exist in the Drupal documentation that detail how to write simple code blocks for this type of task. I do think views would work for you.
Yes, but that limits me to
Yes, but that limits me to displaying biographies in views only. I would have to give access to anonymous users for all bio pages. Then I would control access through a view, which really isn't controlling access. For instance, if a user makes a post in a forum, anyone who clicks the author's profile link would have access to the bio. And removing the link really doesn't solve the problem. It just means the link isn't publicized and obscurity is not security. I have to be able to lock down each node for liability. Thanks for taking the time to post.
www.drupalmuseum.com
www.organicsitedesign.com
Second Stab..
How about Taxonomy Access?
http://drupal.org/project/taxonomy_access
I had a project almost two years ago for a consulting association where I also had to control access to user profiles, making their information into nodes was step one, as I'm sure the bio module has done. And then I faced many similar issues with my project as I created a contractor database where some contractors wished their profiles to be private from anonymous users, while others wished to advertise. There are many more tools available now to control this. Ive never used taxonomy access, but it sounds like it might do what you need.
I'm strongly considering
I'm strongly considering Taxonomy Access as a baseline. It's almost what I need, except it would require an extra human step each time a new user creates a bio. I would either have to give the user permission to choose a category for the bio page, or site editors would have to moderate each new account and select the proper category. Not very elegant and it adds unnecessary maintenance. But I may just have to bite the bullet and modify Taxonomy Access.
www.drupalmuseum.com
www.organicsitedesign.com
how often do your staff
how often do your staff change tho? Make the default entry be unviewable and then you only need to change the taxonomy when you hire someone new. :)
Node Profile
Thanks to everyone for your suggestions. I ended up using Node Profiles by applying the patch discussed here.
www.drupalmuseum.com
www.organicsitedesign.com