Omnis user privileges

Jim Creak jim at jacsoft.co.nz
Thu Jan 12 20:16:48 UTC 2023


We are similar, but instead of location each of our user records have a Character field and we place different letters for each type of security area.

So instead of doing position test we do a pos(Securty_Letter,USERS_Row.Allowed2Do)

Thanks
Jim

JACSoft Programming Ltd. <http://www.jacsoft.co.nz/main.shtml>
> On 13/01/2023, at 6:36 am, Philip Tulett <philip.tulett at pdq-networks.com> wrote:
> 
> Hi Xavier,
> 
> We use a similar method to Franco, but instead of storing the user access in series of 1/0 in a string, we store a number as a 64bit integer and then use the "binfromint64", "bitand" and "bintoint64" functions to decode the individual Boolean flags of what a user is allowed to access.
> 
> Calculate iLvlAdmin as bintoint64(bitand(binfromint64(USERS_Row.USERLEVEL), binfromint64 (1)))
> Calculate iLvlUnderwriter as bintoint64(bitand(binfromint64 (USERS_Row.USERLEVEL),binfro binfromint64 (2)))
> Calculate iLvlUnderwritingAss as bintoint64(bitand(binfromint64 (USERS_Row.USERLEVEL),binfrom binfromint64 (4)))
> Calculate iLvlClaims as bintoint64(bitand(binfromint64 (USERS_Row.USERLEVEL), binfromint64 (8)))
> Calculate iLvlAccounts as bintoint64 (bitand(binfromint64 (USERS_Row.USERLEVEL), binfromint64 (16)))
> Calculate iLvlViewer as bintoint64 (bitand(binfromint64 (USERS_Row.USERLEVEL), binfromint64 (32)))
> 
> Converting the Boolean flags to a value is simpler:-
> 
> Calculate iLvlUser as iLvlAdmin*1+iLvlUnderwriter*2+iLvlUnderwritingAss*4+iLvlClaims*8+iLvlAccounts*16+iLvlViewer*32
> 
> If you have more than 64 items you want to control, you can just repeat the above for a number of 64bit Integers.
> 
> Kind regards
> Philip 
> 
> -----Original Message-----
> From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of Franco Maregotto
> Sent: 12 January 2023 13:50
> To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
> Subject: Re: Omnis user privileges
> 
> As many suggested their own way, I’ll give my 2 cents too, aware that’s not the best solution but just one more.
> When user logins, in user table I have a char field with a long serie of 1 and 0. The browser window (or initial toolbar) will have its construct (or $doInit) method calling a “setButtons” method that enable or disable buttons: i.e.
> If mid(user_permission,1,1)
>  enable/show etc
> Else
>  Disable/hide etc
> End if
> All other windows/menus/etc behave the same way, so the only issue is to be aware of the “position” they must get in the user_permission (something that I store in a comment line in $construct.) As I said, just my 2 cents Ciao Franco
> 
> Inviato da iPhone
> (Franco Maregotto)
> 
>> Il giorno 12 gen 2023, alle ore 14:05, Phil (OmnisList) <phil at pgpotter.co.uk> ha scritto:
>> 
>> Xavier,
>> 
>> As others have mentioned, there are varying ways to do this...
>> 
>> I'll try to summarize what we do, to offer some different views on a solution.
>> 
>> So for us, we have users login, which is linked to a profile...
>> The Profile is limited to what it can do...
>> 
>> Which windows it can access, and when in a window, whether it can edit, delete or create new records...Is all set in the profile.
>> 
>> We have a toolbar to get access to various windows, and also the buttons to create, edit, delete etc.
>> 
>> This leaves us with total control in our toolbar that we created, which is an Omnis sub window with page panes used as button ribbons, so nothing needs to be added to the windows directly...
>> 
>> The Buttons are created programmatically in the first place, which is stored in a schema, which can then be used to setup a permission profile.
>> 
>> We've used this in a number of projects, so we know it works well, and easily changes to the new program.
>> 
>> regards
>> Phil Potter
>> Based in Chester in the UK.
>> 
>>> On 12/01/2023 11:58, IT wrote:
>>> Hi all,
>>> 
>>> I have not implemented a good way to limit user access to my app 
>>> because it was based on legacy omnis users privileges (12345678) and is very limited and hardcoded in the library.
>>> 
>>> Now I want to redo how user are allowed to access to menus and buttons in my Omnis library.
>>> 
>>> If anyone wants to share any insight into how they implemented user access, they're welcome.
>>> 
>>> Regards
>>> 
>>> Xavier
>>> _____________________________________________________________
>>> Manage your list subscriptions athttps://lists.omnis-dev.com Start a 
>>> new message ->mailto:omnisdev-en at lists.omnis-dev.com
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com Start a 
>> new message -> mailto:omnisdev-en at lists.omnis-dev.com
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list