Hi, I have a BeforeCheckInChanges Event Handler which blocks certain actions by raising an error
I want it to only apply to normal users, and not users who have 'Full control of vault' rights - MFUserAccountVaultRoleFullControl
I can set or remove certain roles from a user account in an AfterCreateUserAccount Event Handler:
UserAccount.RemoveVaultRoles(MFUserAccountVaultRoleManageTraditionalFolders) Vault.UserOperations.ModifyUserAccount(UserAccount)
And according to this https://www.m-files.com/user-guide/2018/eng/Event_handlers_variables.html the BeforeCheckInChanges event has access to 'CurrentUserID' and 'CurrentUserSessionInfo'
But then looking at https://www.m-files.com/api/documentation/MFilesAPI~SessionInfo.html it appears SessionInfo has some roles like CanManageCommonViews, but nothing for Full control of vault.
How do I test if the current user has Full control of vault?
Or failing that, test for CanManageCommonViews, as our admins will have that
I feel like I've found most of what I'd need to figure this out, but am struggling to put the pieces together
Many thanks