Trigger Events: User Group?

(Douglas (@finnatic at @waikato)) #1

Matrix Version: 5.4.something

Is there any way to setup a trigger event that checks a user group that the acting user belongs to?

We’ve been discussing a workflow process attached to an asset builder and it would be great to be able to make the newly created assets go automatically live for selected users e.g. those who’ve shown themselves to be capable users of the asset builder.

Happy to see this created as a squizmap if that’s required.

(Emily) #2

Hi Douglas,

Would this suit your needs?

  • After Asset Built (Event)
  • Tree Location of asset (Condition) – asset ID of where your Asset Builder builds to
  • Keyword Value – Keyword: %globals_user_member_groups% “partial match” with [group asset ID] . (Condition)

member_groups is “An array string of the user group asset IDs the current user is a member of.”
So I theorise that if the user is in multiple usergroups, then using the Partial Match should still work.
If you want multiple user groups to be allowed, then the Groups & Conditions Matching version of “Keyword Value” may be appropriate.

  • Set Status (Action)

I haven’t tested this. This is just my theory logic idea.
Hope it helps as a base to test from. :slight_smile:

  • Emily

(Chiranjivi Upreti) #3

This could return false positive result, like user ID 123 matching User Group 1234.

I would recommend using some kind of separator string to wrap the group asset IDs to avoid this:

Trigger condition “Keyword”: %globals_user_member_groups^implode:;^append:;^prepend:;% partial match with ;[user_group_id];

This will wrap the user group ID by “;” so that keyword replacement will return something like ;1234;1235;

(Emily) #4

Yes, this is a good point, Chiranjivi!

Would love to hear if you get it working, Douglas. :slight_smile: Always useful for the future to know if the theory pans out.