This topic is locked

Guest permission problem

11/9/2006 10:22:11 AM
PHPRunner General questions
P
PMCrosby author

Hi

I have set users can only see and edit their own data.
however when logging onto as a guest the following message appears
You don't have permissions to access this table Back to login page
when I change it back to users can see all data but edit their own guest works

Alexey admin 11/13/2006

Peter,
Guest users can not access tables in "Users can see their own data only" mode because they don't have any data.

You can create an additional usergroup i.e. MyGuest and give it permissions on your table.

Then modify generated include\dbcommon.php file.

Find this snippet there:

if(!@$_SESSION["UserID"])

{

$_SESSION["UserID"]="Guest";

$_SESSION["GroupID"]="<Guest>";

$_SESSION["AccessLevel"]=ACCESS_LEVEL_GUEST;

}


and replace it with:

if(!@$_SESSION["UserID"])

{

$_SESSION["UserID"]="Guest";

$_SESSION["GroupID"]="MyGuest";

$_SESSION["OwnerID"]=0;

$_SESSION["AccessLevel"]=ACCESS_LEVEL_USER;

}


You can assign any value in $_SESSION["OwnerID"] variable.

It will be written into OwnerID field in the records created by guest user.

P
PMCrosby author 11/21/2006

Hi

I thought the purpose of a <Guest> login would allow you to list the data from a table no matter who the owner was!!!
Surely the purpose of a registered <users> to login to only see and edit their own data is the point of registering.
As a Newbee I am constantly rebuilding the code, to have to constently change some files becomes time consuming and open to errors.
Also in step 7 (advanced) why if you can select "users can see and edit their own data only" you can still select 'Add login as Guest with Readonly access' if this doesnot give access to the data

Alexey admin 11/22/2006

Peter,
"users can see and edit their own data only" is a table-level setting while "Add login as Guest with Readonly access" is global.
It's senseless to give Guest user more permissions than the registered users have.
If you really wish to allow Guest user view all the data create a custom view for your table and set Users can see all data mode for this table.

Then the Guest user will be able to see all data using this view.

You can create a custom view on Datasource table tab in PHPRunner.