Hi!

 

Great idea! I would do it slightly different though, via the help of a settings table in your database and User().Fullname.

 

The advantages of this is that the users don't need to handle yet another password/passcode and the user also doesn't get the feeling that there are hidden things they cannot see, and they don't need to select their own name. Also, you don't need to add the administration burden of resetting the password if needed, but instead you would have to set each user's access flags. 

 

I would create a new table in the database, in this example called SECDB, containing all the settings your app needs, probably through bit-fields, and the user's full name as the key.

 

When the app starts, in the main form's OnVisible, do a lookup and save the settings in a record so you don't have to repeat the lookup all the time (unless of course, the settings change often):

UpdateContext({rUserSettings:Lookup(SECDB; User = User().Fullname)})

 

Now, in the textbox (or any other control), set the visible flag according to the settings in the user's record: 

 

TextBox.Visible: rUserSettings.ShowTextbox = true

Let's say there's a menu with administrator functions, show or hide it with something like below:

 

mnAdmin.Visible = rUSerSettings.IsAdmin = true

If would be even better if it was possible to add on the security settings in the built in User account, hence drop the need of an extra table. 

 

Hope this makes sense 🙂