What would the calculation look like if I wanted to hide a field or a set of fields based on the user name or account name?
Hide object when.....
Get ( AccountName ) = ____
at a account / user level I'd feel more comfortable with going to a layout having / not having those specific fields on the layout.
IMHO hiding should reflect the data layer at large, not the permissions layer.
Thanks for your input. This did work with just my name however, I need to put in a few users names and when I added another user the object showed up.
Here is my calc.
Worked. Object gon.
Get(AccountName) = "Bob Evans" & "Joe Doyal"
Did not work. Object still there.
Think what will happen when your organization undergoes personnel turnover. Do you intend to go thru your database changing hid object expressions to a different person's account name? Not a good idea. Try to set up such features by either privilege set or extended privilege when possible. That makes managing change a lot easier.
And I would do this to enhance the user experience not to enforce security access, there are better ways for that.
Case ( Get ( AccountName ) = "Bob" ) ; 1; Get ( AccountName ) = "John" ) ; 1; Get ( AccountName ) = "Betty" ) ; 1; 0 // default is to NOT hide)
( Get ( AccountName ) = "Bob" ) ; 1
; Get ( AccountName ) = "John" ) ; 1
; Get ( AccountName ) = "Betty" ) ; 1
; 0 // default is to NOT hide
you can add as many names as you wish to the "list" of those who need to hide.
or you can "reverse" it so that it's NOT hidden if it's you
NOT Get ( AccountName ) = "Admin" // this will not hide if it's you but will for all others
p.s. when it gets this complex, you may go with Priv sets, not accounts, and/or use Phil advice and rethink what you need to hide, why and when.
I use to build a Users table with Name, Lastname, Identification number, Type of user
When user logs, a little script set a global value to 0 or 1. Each time a field must be hiden, I check the value of this global value.
It's not complex to do so, and you can also limit menus, hide tool bar, text bar, prevent some use of objects with this global value.
Thank you Beverly.
It's also not secure.
Retrieving data ...