►Q◄ use built-in Access Levels, or make your own?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2457
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

►Q◄ use built-in Access Levels, or make your own?

Post by Jaymer »

Here's why I ask.

Lets say I have this hierarchy OF ACCESS LEVELS at a company:
Developer (thats me. this is a multi-tenant app. this user can see/do all)
Admin (create any user, any level)
Regional Manager (same, see's only level of his and below)
Office Manager (same)
Sales (no create, level is display only)
Staff (same)
Reception (same)

Those are in order of ability to see/edit/run reports/etc.
An Office manager should be able to edit a user - and the only available access levels available should be at his level and lower.
* A salesrep sees his access level, and can't change it. Only Managers can change someone's level
* An office manager should be able to see all users, and edit access levels. But should only be able to change someone to his level or below him.

INITIAL PROBLEM
... was that using the built-in access levels, there's no hierarchy built in. So aside from hardcoding rules, I don't know which levels are "below" the current users levels.
... which meant that using the Access Level COMBO BOX, any user would see all levels available in the system. They could change to Admin, but then a rule has to kick in and tell them they cannot really change to admin.

MY SOLUTION
... was to use the option "Choices are determined at runtime"
and to make a separate table of levels like this:

Developer_0
Admin_1
Regional Manager_2
Office Manager_3
Sales_4
Staff_5
Reception_6

and when I display a pick list, a custom query only shows levels at the user's level or higher.

Also, this method allows you to type anything into the field that you want, so a rule has to make sure you didn't alter anything.
Screen Shot 2018-08-29 at 3.42.54 PM.png
Screen Shot 2018-08-29 at 3.42.54 PM.png (13.78 KiB) Viewed 2631 times
So I'm wondering if others have had to make alternatives to built-in Access Levels, or is the supplied Aware-way sufficient for your applications?
thx, jaymer...
Last edited by Jaymer on Wed Aug 29, 2018 7:43 pm, edited 2 times in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

Re: ►Q◄ use built-in Access Levels, or make your own?

Post by JonP »

I probably should have done what you did, but I wanted to give my customers even more fine-grained control. I kept AccessLevel for determining User/Admin privileges (admins can purchase/assign licenses and invite users) and then added a table called Role which has a name attribute (i.e. Sales, Developer, etc.) and combo-boxes for what level access (somewhat based on RACI) that role allows for each area of the system. Then an admin can assign a license and a role to a user. Probably overkill for most people.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Post Reply