Home
The Toolkit for Online Communities
15902 Community Members, 0 members online, 2493 visitors today
Log In Register

Forum .LRN Q&A: Problem with Privileges

OpenACS Home : Forums : .LRN Q&A : Problem with Privileges

Icon of Envelope Request notifications

+
Posted by Ashem Yadava on
Hello

I am trying to ban or unban a user from my program. When I ban the user, I grant the permission called ban on an object id for a party id. So I can fetch the list of banned users by saying -

..where privilege = 'ban'.

However when I want to find out the users who are not banned, if I say ...fetch users where privilege != 'ban',  I get banned users along with the unbanned users.

Can anyone please suggest me a solution, how can I separate banned users from unbanned users. I basically want 2 lists.. so if I ban a user, its name should appear in the list of UNBAN this user and whereas if I unban a user its name should appear in the list BAN this user.

I hope I have made myself clear. Any suggesstions are appreciated. I know of a way but its not elegant and its not what I exactly want.

Many thanks
Ashem Yadava

+
Posted by Don Baccus on
Look at "groups-create.sql" in the kernel datamodel (acs-kernel/sql/oracle or postgresql).  Members of your site have a state associated with them, and one possible value for that state is "banned" ...
+
Posted by Don Baccus on
In general, don't use permissions to track the state of an object.  Only use permissions to track whether or not a party can do a particular operation on another object (or to itself).
+
Posted by Ashem Yadava on
Thanks Don.

Ashem