No obligation to log in and permissions by default

Archived from the Xataface Users forum.

Jean — Mon Aug 31, 2009 4:48 am

Hi Steve and all,

I searched for this kind of configuration in the forum but did not find it. What about a site where permissions are set by default on READ_ONLY but where the admin can log in to do all others operations, just like in a blog ?

Jean


shannah — Tue Sep 01, 2009 6:29 pm

Code: Select all
function getPermissions(&$record){     if ( isAdmin() ) return Dataface_PermissionsTool::ALL();     else return Dataface_PermissionsTool::READ_ONLY(); }

Byte — Wed Sep 02, 2009 6:01 am

Hi,

Since I have the same thing over and over again: how about including this information in one of the ini files? Would be much easier to configure that way than to include this piece of code…

Something like:

[access]

admin = all

editors = all

other = read_only

where the key is always a group name, the value are the constants that you expect in the code..

What do you think? Of course this does not cover all possibilities (like permissions based on record values) but I think it would be sufficient in 99% of the time.