Permissions [SOLVED]

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

Permissions [SOLVED]

Postby cantlep » Wed Sep 01, 2010 4:49 pm

Hi Steve,

If i've given a user some perms in permissions.ini (in this instance i've extended READ ONLY to allow some writing (similar to EDIT but a few less perms)) Is there a way I can stop them writing to a particular table?

i.e. A user called User1 has (for this example) EDIT permissions. They can edit all tables by default...but I don't want them to be able to create new users so I want to restrict their access to the User table to READ ONLY (this way, at least they can still view their profile, etc).

Any ideas?

Just found this: - http://xataface.com/wiki/fieldname__permissions Is this what I need to be using?

Thanks

Paul
Last edited by cantlep on Thu Sep 02, 2010 9:22 am, edited 1 time in total.
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Permissions

Postby cantlep » Thu Sep 02, 2010 9:22 am

I've accomplished it with this in the table delegate class for "Users"
Code: Select all
//Restrict Non-admin users to read only on the Users table
function getPermissions(){
    $auth =& Dataface_AuthenticationTool::getInstance();
    $user =& $auth->getLoggedInUser();
    if ( $user and  $user->val('Role') != 'ADMIN' ){
    return Dataface_PermissionsTool::READ_ONLY();
}
}
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 38 guests

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