This is a great module! Just what I was looking for to segregate contect based on user roles. However, there's one funny thing going on, and I'm not sure if it falls into the "feature" or "bug" category, but it was suggested in the forums that I post here as an issue.

If a user has multiple roles, and a forum topic has access permissions for each of those roles, the forum topics are duplicated one time for each role for that user.

For example, if a user is set up with the following three roles:
1) authenticated user
2) contributor
3) developer

And a forum topic is created with access permissions for each of these roles, when the user visits the forums, it will
A) display "3 new" instead of "1 new" next to the forum title, although only one topic was created
B) display the topic three times in the forum
C) display the topic three times under "Active forum topics:" and "New forum topics:" if the forum topics block in enabled.

This does not seem to be the case for the main (admin) user login (that is, the first account created when setting up drupal). I can assign all of the roles to my admin login, and this does not occur. It is only an issue for subsequently created users.

Anyone know what I'm missing here?

Thanks!

Comments

stelman’s picture

I had another related issue come up. I logged in as a user that had two roles assigned ('authenticated user' and 'role2'). As that user, I created a forum topic, and only gave view permission to 'role2'. In the forums, I noticed it showing up twice, indicating something related to this bug.

I went through several iterations, logged in as admin, of removing and adding 'role2' permissions to the node. When I did, and *no* view permissions were granted, it still showed up when logged in as that user.

What I finally found out, by looking at the mysql tables, was that the node_access table had an entry for that nid for a gid=2 (authenticated user) that I never assigned to it. Nevertheless, I tried assigning and unassigning permission to view that node for 'authenticated user', but the entry was never altered in the mysql table. I ended up having to manually remove it from the table to get things fixed.

I know this is probably one of those things you will not be able to replicate, but whatever caused this problem, it was only noticable as a problem because of the original bug I reported above.

stelman’s picture

Disregard that last comment. I realized that the duplication this time was being caused by node_privacy_byrole_role granted view for that role id, and node_privacy_byrole_user granted view for that user id.

So the duplication this time is caused by a user have both role and user id's granted view.

I any case, if a particular user has more than one applicable grant_view set to true, the forum shows up twice. That is, for each user id and role id assigned to a particularl user that has grant_view = 1, that's how many times the forum topic will be displayed.

I'm guessing this is a bug in the forums module, not in this module. I'll make this inactive once I can verify.

stelman’s picture

I just verified that this does not only occur with forum topics, but also with other contect types, such as events.module.

It does not seem to be a problem with pages, though.

stelman’s picture

This was a problem in the forum.module. In case anyone else is wondering, this is being dealt with here:

http://drupal.org/node/11871