Jump to content
Server Maintenance This Week. ×

Button Hide for Priviledge Sets


This topic is 3637 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ) ) )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 3637 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.