No obligation to log in and permissions by default

A place for users and developers of the Xataface to discuss and receive support.

No obligation to log in and permissions by default

Postby 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
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby 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();
}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby 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.
Byte
 
Posts: 13
Joined: Thu Jul 16, 2009 3:48 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 13 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved