09-18-2017 08:42 PM
Hi Guys,
Is it possible to remove Document Create privileges from some User Group? It's some reasons I do need to avoid them to create/upload document and allow them later using Unity Script.
I would be grad if you could show me a sample code also [emoticon:c4563cd7d5574777a71c318021cbbcc8]
Thank you.
KOBPONG
09-19-2017 08:39 AM
Hi Kobpong,
While you can't programmatically add or remove permissions from a group, I believe you can still accomplish what you're setting out to do.
Let's say all users you want to modify belong to the group "General Users". This group should never have the Document Create privilege on it. Create a separate user group called "Document Creation". From your script, you can iterate through all your users with unityApp.Core.UserAdministration.GetUsers()
, and filter out the ones that belong to group "General Users". For instance, by unityApp.Core.UserAdministration.GetUsers().Where(user => user.GetUserGroups().Contains(generalUsersGroup))
. Then, for each resulting user, you may call unityApp.Core.AddUserToGroups(userAtCurrentIndex, groupCollection)
. When you want to programmatically remove this privilege, simply apply the same logic with unityApp.Core.RemoveUserFromGroups()
. Functionally speaking, this should have the same effect of applying and removing the Create privilege programmatically.
Good luck!
Best,
Ariel Koiman
Developer II, Capture
09-19-2017 08:39 AM
Hi Kobpong,
While you can't programmatically add or remove permissions from a group, I believe you can still accomplish what you're setting out to do.
Let's say all users you want to modify belong to the group "General Users". This group should never have the Document Create privilege on it. Create a separate user group called "Document Creation". From your script, you can iterate through all your users with unityApp.Core.UserAdministration.GetUsers()
, and filter out the ones that belong to group "General Users". For instance, by unityApp.Core.UserAdministration.GetUsers().Where(user => user.GetUserGroups().Contains(generalUsersGroup))
. Then, for each resulting user, you may call unityApp.Core.AddUserToGroups(userAtCurrentIndex, groupCollection)
. When you want to programmatically remove this privilege, simply apply the same logic with unityApp.Core.RemoveUserFromGroups()
. Functionally speaking, this should have the same effect of applying and removing the Create privilege programmatically.
Good luck!
Best,
Ariel Koiman
Developer II, Capture
09-19-2017 02:07 PM
11-01-2017 03:44 AM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.