• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Rights per groups

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
More I study I think it's a bug.

Follow this:
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,
method
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]
 
New rule: no elephants at the chess tournament. Tiny ads are still okay.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic