When a new forum is added, it's acces, read-only, etc... is set.
This is done by a call to
addRole(PermissionControl pc, String roleName, int forumId, String groups, boolean allow)
If nothing is selected in the groups html listbox then the method above is called with
allGroups and true as it's last 2 parameters, meaning that a value of 1 = allow will be added for each existing group.
When something is selected in the groups html listbox, the call above is made using that something as the groups and false for allowance, meaning that a value of 0 = not allow will be added for each selected group AND NOTHING for the other existing groups.
So, when testing for allowance
in the class PermissionControl,
public boolean canAccess(String roleName, String roleValue)
the test is done as a search in the map of rolevalues, seeking for a value of allowance = true = 1, but remember that it was added to the db only the value of not allowed.
So I think it's a bug. Please tell me as soon as possible what you think, if I may correct it or I'm wrong.
Thanks [originally posted on jforum.net by danidacila]
I have created a category, and in it a forum General rules for posting.
I want to allow posting here only for admin and for others to be read-only.
So I selected read-only to all groups except Administration, the group of Admin.
The thing is that it does not work.
Nobody can do a new topic now.
Why? Please help. [originally posted on jforum.net by danidacila]
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop