Gossamer Forum
Home : Products : DBMan : Installation :

Permission for Modify

Quote Reply
Permission for Modify
I have read JPDeni's tutorial but it did not cover my problem. I tried a few configurations but I don't think I have it right. It doesn't find a registered user's record. I am also trying to use my filed ID as a USERID and it is automatically updated. Using JPDeni's list, here's what I need:

View/Search: registered user
Add Records: admin
Modify Records: registered own
Delete Records: admin

My present configuration is:
$auth_no_authentication = 0;
$auth_allow_default = 0;
@auth_default_permissions = (1,1,0,0,0);
$auth_signup = 0;
@auth_signup_permissions = (1,0,0,1,0);
$auth_modify_own = 1,0,0,0;
$auth_view_own = 0;
$auth_user_field = 1;

record layout:
'Name' => [ 0, 'alpha', 40, 255, 1, '', ''],
'ID' => [ 1, 'numer', 4, 255, 1, '', '\d{1}'],
'Formal' => [ 2, 'alpha', 40, 255, 1, '', ''],
'Address1' => [ 3, 'alpha', 30, 255, 1, '', ''],
'Address2' => [ 4, 'alpha', 30, 255, 0, '', ''],
'City' => [ 5, 'alpha', 30, 255, 1, '', ''],
'State' => [ 6, 'alpha', 0, 2, 1, '', ''],
'Zip' => [ 7, 'numer', 5, 255, 1, '', '\d{5}'],
'Email' => [ 8, 'alpha', 40, 255, 0, '', '.+@.+..+'],
'HomePhone' => [ 9, 'alpha', 12, 255, 0, '', ''],
'WorkPhone' => [10, 'alpha', 12, 255, 0, '', ''],
'Fax' => [11, 'alpha', 12, 255, 0, '', ''],
'Birthdate' => [12, 'date', 20, 255, 0, &get_date(), ''],
'YearActive' => [13, 'numer', 4, 255, 0, '', '\d{4}'],
'Occupation' => [14, 'alpha', 60, 255, 0, '', ''],
'Position' => [15, 'alpha', 60, 255, 0, '', ''],
'PreviousPosition' => [16, 'alpha', 60, 255, 0, '', ''],
'Filename' => [17,'alpha', 0, 255, 0, '',
Quote Reply
Re: [crenshrd] Permission for Modify In reply to
I see a few problems you have your ID field setup as a numeric field. If this is your userid field then it should be alpha.

Do you have:

$db_key = 'ID';
$db_key_track = 0;

View/Search: registered user

To have a registered user they must have the ability to signup. You are not letting them add records? If not how are you going to associate them to their record?

$auth_signup = 1;
@auth_signup_permissions = (1,0,0,1,0);

Modify Records: registered own

$auth_modify_own = 1; ## this is just a yes/no

Unoffical DBMan FAQ

Quote Reply
Re: [LoisC] Permission for Modify In reply to
Hi again. I see you decided to tackle this one too.
I understand what your saying and associating the users is a problem. I have about 150 users I want to preload from and Access DB (as a test I have done some of them already). After the preload I want admin to add users and the users to make there own changes but not delete. We all have our special problems don't we. If this is clear to you, do you have any suggestions?
Quote Reply
Re: [crenshrd] Permission for Modify In reply to
Do you have passwords in the access database also or just the usernames?

Check out this thread by searching the forum or the FAQ

"Can I Import PreDefined passwords?" (Access database)
Thread: http://gossamer-threads.com/p/85084
Topic: Can I Import PreDefined passwords?
Posted by kvdr - 1-Jun-00

(If the thread reference doesn't work search by the title)

If you don't already have passwords you could assign a general password for all users and then add the change password mod so they could change their password to what they want. But to associate each with their own record you would need a userid field.

Another thought would be to also export your access database into excel and create a field for the userid. Say if you had a fields as first name and last name. You could take the last name field and create a userid field defining their userid as:

First Initial and last name (up to 10 characters). That would be easy for everyone to remember and easy to import into your db file.

So for example if you had a John Jones it could be JJones and you would only have to add the first initial to the last name field.

I've created several large database offline working in excel and then just uploading the file to the server.

Hope this helps

Unoffical DBMan FAQ


Last edited by:

LoisC: Feb 22, 2002, 5:28 PM
Quote Reply
Re: [LoisC] Permission for Modify In reply to
Everything is working so far except for the registered user modifing their own record. Passwords are loaded and work fine. How does the search determine that this is a registered user and that he/she is trying to modify their own record. When I log in as a registered user and try to modify, I get "Error: No matching records". Could I preload the userid field with the userid?
Quote Reply
Re: [crenshrd] Permission for Modify In reply to
Could I preload the userid field with the userid?

If you're uploading the data from a file, yes you should be able to prepopulate that field. If you're logged in as admin and modify or add the record, your admin userid is ging to populate the field unless you do some modifications to your database. There have been some discussions on allowing admin to change records without changing ownership of the record. Try searching this forum and check on LoisC's resource site to locate threads.

~ Karen