Writing Permissions

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
Torniquet
Posts: 869
Joined: Sun Aug 02, 2009 6:18 am

Writing Permissions

Post by Torniquet »

hey peoples.

a quick question for youll i would like your views on.

I am currently comming up to the stage of setting up permissions for users against forums.

the way i did plan on doing it is a string against each user and forum which contained the appropriate ID followed by the permission codes and settings (like the below)

Code: Select all

f1@r1:1;r2:1;r3:0....

{forum ID}@{permission ID}:{permission setting};{permission ID}:{permission setting}.....
then all i have to do is split the permission into an array and access by $permissionset[$forum][$permission]

but when loading the permissionset up i am loading every permission when i only really need 1 set.

The only other way i have thought about doing this is by tables and load up only the forum and user rule i need. But the problem here is that a row is needed per user per forum which could potentially result in alot or damn rows lol.


what are your views on this? and are there any other routes i could take to achive the best of both worlds? contain everything in a small space, and limit what i am loading to what i needed.
New Site Coming Soon! Stay tuned :D
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Writing Permissions

Post by Xaleph »

You could look in to the ACL protocol. This is a common method on giving or taking rights. You assign roles to users or set special permissions for users. All it means is, once a user logs in, an array of all actions which are allowed for this person, are put in an array. Now, on page load you can verify all actions_allowed against the page. Same goes for all buttons for replying, moderating, et cetera.
Post Reply

Return to “General Development”