This topic is locked

One table, many rights

11/15/2006 11:51:08 AM
PHPRunner General questions
J
Jean author

Anybody could tell me if that possible with phprunner ?
1.
UserA can add/edit/list/... his own records in a table

and

he can add/list the records of just one other user UserB in the same table,

but

without any rights on the datas of the other users (UserC, UserD) writing in the same table.
2.
If not possible, would it be easy to obtain this result using two tables, one for individuals records, the second for collective records ?
I would like that users have full rights on their individual records which are not accessible to others and limited rights (add/list) on a collective part of the table.
Jean

Sergey Kornilov admin 11/15/2006

Yes, this is possible in PHPRunner.
You can use "Users can see and edit their own data only" security mode and make user A and user B have the same OwnerID value.

J
Jean author 11/15/2006

Seems very cool Serguey, but I fail to obtain the good result. Both user A and user B may modify records of each other. Though I remember having used "..their own data only". Please, can you tell me how I can verify in the code that I did choose the good option + explain to me how the routine does recognize the right owner having the same ownerID. It can help me to understand why it doesn't function in my database. Am I just clumsy?
Thanx.
Jean

Sergey Kornilov admin 11/15/2006

I'll try to clarify this a little bit

Login table

Username OwnerID

------------------------

User A 1

User B 1
Main table

ID OwnerID

-------------------------

1 1

2 1

3 2

4 3

5 1


In this situation both User A and User B will be able to edit records 1,2,5
If this doesn't work for you show what you got in your database.

J
Jean author 11/16/2006

Thank you Serguey. I understand that I have to correct my UsersTable because I made just one same field for Username and ownerID. May I continue with this question:
I understand that with
UserA ownerID=1

UserB ownerID=1

UserC ownerID=2
UserA will see and edit his own records, will see the records created by UserB and will not see the UserC records. UserB will have the same position as UserA.
May the UsersTable make a User to have many ownerID, say UserA have ownerID 1 and 3 ?

Why that ? With your solution, userA and userB have no private area, they see the whole content of each other. I would like to create a collectiv area near private areas. May I do that in the UsersTable:
UserCollectivAccount = 3
UserA = 1

UserA = 3
UserB = 2

UserB = 3
UserC = 4
UserD = 5

Sergey Kornilov admin 11/16/2006

PHPRunner allows you have a single ownerid per user.