Active
Project:
Privacy Per User
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2011 at 17:18 UTC
Updated:
3 Jul 2011 at 13:36 UTC
Could you maybe supply some more example code? This module does seem as something that drupal needs but i'm not sure how to use it.
Let's say i want to have a node that i want to user to choose who can view it:
- No one
- Everyone
- Only registered
- Friends (user_relationships)
I guess it would, but would this be possible with this module.
Comments
Comment #1
gilgabar commentedCurrently this module is intended to be used to allow users to control access to their instance of things that every user has - a profile, for example, or a track page. An individual node is something that one user may have, but another user may not and so it would not make sense for a privacy setting to appear for it on every user's settings page. There are other modules that already allow you to control access to nodes, so no effort was made to include that functionality. Though it may be possible at some future point if it makes sense.
For the extra privacy states that you mention it should be fairly easy to add those. Look at the privacypu_flag_friend.module for an example of how to implement those. In the registered user example you would just load the global user object and then check whether that has the required role. Return true if it does, false if it does not. I haven't used user relationships, but I imagine the privacy state callback would look similar to the flag friend privacy state callback, a sql query that checks if a friend relationship exists for the two users and then returns true if it finds one of false if it does not.
Check out CCK privacy, node access, content access, and the user relationships node access modules. There may also be others. If none of those meet your needs for node privacy then feel free to turn this issue into a feature request. I can't promise anything would happen in any kind of reasonable timeframe, but that would be the first step in making it happen.
Comment #2
Michsk commentedI got it, thanks for explaining.
All the modules you mention are good ones and i have looked at, but they all dont show a privacy opion when creating the node. All have a own privacy tab so you first have to save the node and then you can set the privacy. I will look at it.
Comment #3
qmhao99 commentedThis sounds like a great module and exactly what I would need! However I am not exactly sure how to customize it for different content types. Let's say I have a node type called "album" and I want each user to have control over who has access to their albums. What's the best way to implement this? Thank you in advance!
Comment #4
gilgabar commentedAt the moment the best way to do that is to turn this issue into a feature request, which I've just done. As mentioned above, per node privacy with this module might be a little tricky as it doesn't fit the current paradigm of setting privacy preferences in user settings. But per content type privacy, which is what it sounds like you are after, would be a much easier feature to implement and makes a lot of sense within the existing framework.
The way that might work would be to have settings on the content type edit form to select a privacy type that would govern the nodes of that content type. Alternatively settings could also be provided on the privacy type edit page in the form of checkboxes for each content type. The node author would set their privacy settings on the user settings page. Then when a node is viewed it would check the privacy settings of the node author for that privacy type and display or not accordingly.
To use your example, a user might have an 'Albums' privacy setting on their user settings page, then any album node that they create would be governed by that privacy setting. Does that sound like it would meet the requirements for your project?
Comment #5
qmhao99 commentedThank you for your quick response. Yes this is exactly what I was looking for. When do you think this feature can be released?