Allow Read Only Access Without Having to Login?

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

Allow Read Only Access Without Having to Login?

Postby rhc » Sun May 22, 2011 1:06 pm

I have 3 custom permissions roles set up and working fine. However I would like to give "the world" read only access to application without having to login. Is there some way to do this? Even if its something like passing the readonly userid and password as parameters in the hyperlink someone clicks on, on a different web page?

thanks in advance for your help.
rhc
 
Posts: 12
Joined: Sun May 22, 2011 12:01 pm

Re: Allow Read Only Access Without Having to Login?

Postby PaulR » Sun May 22, 2011 1:26 pm

Hi rhc,

I wanted to do exactly the same thing a couple of days ago - the answer is in this thread (you need to use delegate classes for each table):

viewtopic.php?f=4&t=6047

My table 'SITE_RECORDS' has a file SITE_RECORDS.php that looks like this:

Code: Select all
class tables_SITE_RECORDS{

     function getPermissions(&$record){
         $auth =& Dataface_AuthenticationTool::getInstance();
         $user =& $auth->getLoggedInUser();
         if ( !isset($user) ) return Dataface_PermissionsTool::READ_ONLY();
             // if the user is null then nobody is logged in... no access.
             // This will force a login prompt.
         $role = $user->val('ROLE');
         return Dataface_PermissionsTool::getRolePermissions($role);
             // Returns all of the permissions for the user's current role.
      }
    
}

?>



Paul

EDIT: Note the comment is wrong (I copied it from the wiki), it gives READ_ONLY access not NO_ACCESS.
PaulR
 
Posts: 19
Joined: Tue May 17, 2011 10:38 pm


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