This topic is locked

Help: How to Assign Another Username as Admin

7/5/2020 5:11:22 AM
PHPRunner General questions
mcgeepj2 author

With my Security setup as pictured below, I can't figure out how to assign certain users to the 'admin' group. Do I need to add another field in my 'users_pn' table for the group name? Or is my security settings wrong?
As-is, anyone who creates a record has EDIT access to only their record.

D
david22585 7/5/2020



With my Security setup as pictured below, I can't figure out how to assign certain users to the 'admin' group. Do I need to add another field in my 'users_pn' table for the group name? Or is my security settings wrong?
As-is, anyone who creates a record has EDIT access to only their record.



You need to setup another field in your pn_users table that defines the user access level. What you have right now for admin access, is the username that's used to login, which means every single username would have to be added on the user group permission screen.
What I did was was setup a field called group, and then I set each group on the "User Group Permission" page as the following:
0 - Admin

1 - User

2 - Former User

3 - Pending

4 - Blocked
This way that when a user signs up, they are defined as 3 awaiting to be assigned a status. Then they're assigned to 1 as a user, or 0 as an admin. Once they are no longer part of what we need, then they go down to 2 so they can still view their data if needed. I used 4 if I need to block a user from trying to continually sign up.

D
DealerModulesDevClub member 7/5/2020

In your app when you add or edit a user, you should have a field called group. Just make sure that it says "admin" in the group field and that user will be able to see all entries.
If you want to take it from basic to the next level, I suggest following two youtube videos:
https://www.youtube.com/watch?v=hFKUVOPi2ss
https://www.youtube.com/watch?v=f6OFNRGCqyw
Paul

Sergey Kornilov admin 7/5/2020

Yes, you need a separate field to store the group name or group id.

mcgeepj2 author 7/5/2020



You need to setup another field in your pn_users table that defines the user access level. What you have right now for admin access, is the username that's used to login, which means every single username would have to be added on the user group permission screen.
What I did was was setup a field called group, and then I set each group on the "User Group Permission" page as the following:
0 - Admin

1 - User

2 - Former User

3 - Pending

4 - Blocked
This way that when a user signs up, they are defined as 3 awaiting to be assigned a status. Then they're assigned to 1 as a user, or 0 as an admin. Once they are no longer part of what we need, then they go down to 2 so they can still view their data if needed. I used 4 if I need to block a user from trying to continually sign up.


Thanks,
Where in the "User Group Permission" page did you identify the groups with numbers?
0 - Admin

1 - User

2 - Former User

3 - Pending

4 - Blocked

D
david22585 7/5/2020



Thanks,
Where in the "User Group Permission" page did you identify the groups with numbers?
0 - Admin

1 - User

2 - Former User

3 - Pending

4 - Blocked


When you add a group on the page your on, I used numbers instead of words for the group. I prefer this method, and then a call to a settings table that defines the name of each user access level. I do this for DB space savings.