Not sure if this is a bug or a documentation issue, but when an anonymous user makes a submission and marks certain fields as private, I was expecting that they would only be visible to roles with the granted permission only. But they are also available to the user who made the submission. Because this is the Anonymous user, the fields are shown to everybody. Therefore they are not private.

CommentFileSizeAuthor
#4 privacy-n592194.patch873 bytesdamienmckenna

Comments

enjoy777’s picture

hi
I am not sure why anonymous user can mark some fields as private?
If he is anonymous in my opinion he shouldn't have option to do this. This option should be available to registered users. I think it is not a bug only good working of this module if anonymous can mark some field as privacy and everyone can be anonymous so everyone can see it. It is logical approach.

kwinters’s picture

"Anonymous" in many cases is the same as "user unknown" -- the node may have been created by a script, etc. This is a fairly common situation and it's easy to do on accident.

However, anon is rarely given access to edit nodes, even ones "created by" them. So, they won't have access to the info through the edit node form.

I think it would be better to let no one see the private info on the node view, regardless of whether or not they are the author. If you don't want to do that, it would still be a good idea to put a warning on the edit form when the uid is zero, since most of the time that will be an accident and people won't have any idea what's going on.

kwinters’s picture

Title: Fields marked as private by an Anonymous user are shown to all » Private fields are visibile on nodes owned by anonymous

if ($user->uid == $node->uid || user_access('view all privacy')) {

Adding a condition on there && $user->uid > 0 would be the simplest change.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new873 bytes

Here's a patch that adds the additional check, e.g.:

        if (($user->uid > 0 && $user->uid == $node->uid) || user_access('view all privacy')) {