This topic is locked
[SOLVED]

 How can admin add record as a user?

3/1/2011 7:49:25 AM
PHPRunner General questions
K
komlos author

How can admin add record as a user so the owner will be the user?

As admin I can edit users' record fine, but when I try to add a new record the owner of the record becomes the admin.
I use the following settings:

For the table: "Users can see and edit their own data only".

I have two user groups: <Default> and "Admin". For Admin group I checked: "Admin group (can see and edit all records)"
I tried to switch on the "user_id" field for the Add page, make it readonly, and then tried to add a record by going first to all records detail page of the user, and then "Add new". On the Add form it shows the user's user_id as a readonly field, fine, but when I add the record and go back to list page I can see that the owner of the record is the admin!
I have thousands of users so selecting a user from a dropdown is not an option...
Thanks

P
procheck 3/1/2011

Make sure that your default is being created in the user group. You might need to create a view for admin (for example: admin_name) then change the permissions to match.

Sergey Kornilov admin 3/1/2011

The easiest way is to create an additional View for the admin that doesn't have "Users can see and edit their own data only" mode turned on. You can restrict access to this view via 'User Group Permissions' and admin can use this view to add data as a user. UserID can be a dropdown box in this case.

K
komlos author 3/1/2011

Thanks. The important step after you have created the custom view that you need to set for it "Users can see and edit other users data" at the security tab. Then you have to add admin permission to that custom view and no user permission. That's it.