Max Magid
Max Magid

Reputation: 355

How to conditionally hide a section base on current user's group membership in workshop?

I tried to use the workaround where we simulate it with a headerless collapsable section, using a variable to control the collapse state.

However it seems that there is no way to make a variable based on user's properties such as group membership, userid, etc.

Ideally I would reference the validity of the action parameters to reuse the permission there.

Is there any way to implement this currently?

Upvotes: 0

Views: 137

Answers (1)

Max Magid
Max Magid

Reputation: 355

If you create a string array variable in Workshop, you can initialize it to Multipass attributes such as group membership:

https://i.sstatic.net/mAtIt.png https://i.sstatic.net/PUhlm.png

Section visibility is controlled by boolean variables, so you then you want to pass this string array into a Function, evaluate the groups as needed within the Function, and then return a boolean variable that will control the visibility of your section as needed. https://i.sstatic.net/Q3uq7.png

Upvotes: 1

Related Questions