Martin_S Posted May 13, 2014 Posted May 13, 2014 I have a home screen which contains 11 buttons. The top button is visible to all. The top 7 buttons are visible to those users in a Priviledge Set called 'Office_Admin' All 11 buttons are visible to those users in a Priviledge Set called 'Sys_Admin' Can anyone please help me understand the logic for the 'Hide object when' property for each set of controls based on the user's priviledge set? Thanks Martin
Lee Smith Posted May 13, 2014 Posted May 13, 2014 Did you watch the video at FileMaker Inc control object visibility There are a couple of training sites that show this. I just did a search of YouTube and got a few more videos on this subject. Youtube filemaker hide objects HTH Lee
Martin_S Posted May 14, 2014 Author Posted May 14, 2014 Hi Thanks but am not able to watch video content at work. I got around the issue by creating Extended Priviledge Sets called for each user tpe, and then a variation of the following to hide/show the relevant buttons: PatternCount( Get ( AccountExtendedPrivileges ); "sysadmin" ) = 0 Thanks Martin
Lee Smith Posted May 14, 2014 Posted May 14, 2014 These are NOT movies, they are how-to videos lasting only a few minutes. You can spend a little time watching a videos, or all day asking the same questions. You might also think about attaching a file, to help speed this along. Lee
jbante Posted May 14, 2014 Posted May 14, 2014 Martin, I wouldn't say you "got around the issue" by your use of extended privilege sets — this is exactly what extended privilege sets are for! A calculation like this might perform slightly faster: IsEmpty ( FilterValues ( "sysadmin" ; Get ( AccountExtendedPrivileges ) ) )
Martin_S Posted May 15, 2014 Author Posted May 15, 2014 These are NOT movies, they are how-to videos lasting only a few minutes. You can spend a little time watching a videos, or all day asking the same questions. You might also think about attaching a file, to help speed this along. Lee Hi Lee. Apologies, it seems I can view the first link now (wasn't able to yesterday), though I can't watch any youtube content at work as it is blocked. I'll take a look, thanks. Martin, I wouldn't say you "got around the issue" by your use of extended privilege sets — this is exactly what extended privilege sets are for! A calculation like this might perform slightly faster: IsEmpty ( FilterValues ( "sysadmin" ; Get ( AccountExtendedPrivileges ) ) ) Well, what I mean to say was I found a workable solution for my issue but was struggling with the logic when buttons should be visible/not visible. I added the extended sets and have since created three custom functions, IsUserSysAdmin, IsUserOffAdmin and IsUserUser, and with the extended priviledge sets in place, my functions were modified to use PatternCount( Get ( AccountExtendedPrivileges ); "sysadmin" ) > 0 Therefore, returning a boolean. I then used the functions to determine the visiblity, as IMO its neater than having too much code in the control visibility property. So for the first button, there is no code in the property (as all users see it). For the next block of buttons, the property simply contains 'IsUserUser' (therefore hiding the object if the user is not sys admin or office admin), and for the last block, I used 'IsUserOfficeAdmin or IsUserUser' (therefore hiding the buttons if user or office admin) (as these are ony visible to sys admin users). I assume if using your code, I could use not IsEmpty ( FilterValues ( "sysadmin" ; Get ( AccountExtendedPrivileges ) ) ) to return true for a sysadmin user? it's useful to know a slightly faster approach, thanks for the tip. Assuming my revision is correct, I'll update my functions accordingly (which is much easier than updating all the controls!) Cheers Martin
jbante Posted May 15, 2014 Posted May 15, 2014 I assume if using your code, I could use not IsEmpty ( FilterValues ( "sysadmin" ; Get ( AccountExtendedPrivileges ) ) ) to return true for a sysadmin user? it's useful to know a slightly faster approach, thanks for the tip. Assuming my revision is correct, I'll update my functions accordingly (which is much easier than updating all the controls!) Yes, it looks like you've got the right idea.
Martin_S Posted May 16, 2014 Author Posted May 16, 2014 Yes, it looks like you've got the right idea. Excellent, thanks.
Recommended Posts
This topic is 4113 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now