• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

New topic problem

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • 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]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!