• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

New topic problem

 
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]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic