Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
10 subscribers
Views
5220 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi I have a scenario in which user can select a user from a particula
komalc3
A Score Level 1
over 9 years ago
Hi
I have a scenario in which user can select a user from a particular user group. I have used the function isusermemberofgroup() in the validations of pickerFieldUsers() which works as per desire when I am logged in as Admin.
My code is:
a!pickerFieldUsers(
label: "Select User : ",
labelPosition: "ADJACENT",
maxSelections:1,
value:ri!user,
saveInto:ri!user,
validations:if(isnull(ri!user),{},{if(isusermemberofgroup(ri!user,cons!USER_GROUP)," ","Please select the correct user")})
)
But when I log in as a basic user I get an error as:
Error evaluating function 'isusermemberofgroup' : PrivilegeException[null=>null]: Insufficient permission
Can anyone please suggest as to how to handle this scenario.
Thanks in advance!!
OriginalPostID-167775
OriginalPostID-167775
Discussion posts and replies are publicly visible
0
Tim
Certified Lead Developer
over 9 years ago
You should use the groupFilter attribute for this type of requirement.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
komalc3
A Score Level 1
over 9 years ago
Hi Tim
Thanx for replying!!
The groupfilter attribute also thros the same error, tested it as well.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rahul Gundu
over 9 years ago
Basic users are restricted because of group security and group privacy policy. Make the group security as public and group privacy policy as low.
The tutorial will help you.
forum.appian.com/.../Configuring_Security_for_Groups.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
komalc3
A Score Level 1
over 9 years ago
Thanx Rahul!!
It is working as per desire.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chris
over 9 years ago
In addition, if you run into this again and can't modify group security - for those cases I've created a function to check based on group name which utilizes the getgroupsformemberuser() function, to avoid security restrictions.
contains(
apply(
fn!tostring,
apply(
fn!getgroupnames,
getgroupsformemberuser(
ri!userIn
)
)
),
ri!groupName
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jayashrib223
over 7 years ago
in reply to
Chris
We are using function "getgroupsformemberuser" like this:apply(fn!getgroupsformemberuser,<lastUpdatedUserId>).
This works fine in all environment except the one where we get error as:- com.appiancorp.suiteapi.common.exceptions.AppianException: Incorrect privileges to get groups for user. [User Context: We get error when <lastUpdatedUserId> is not part of logged in user's group.
We checked that group security setting are same as in other environments - group security as public and group privacy policy as low.
Please suggest
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jamal Case
Certified Lead Developer
over 7 years ago
Another way you can implement this is by using the groupFilter parameter to filter to only show users in that group and remove the validation since you won't be able to choose a user that's not in that group. This is a code snippet you can use:
a!pickerFieldUsers(
label: "Select User : ",
labelPosition: "ADJACENT",
maxSelections:1,
value:ri!user,
saveInto:ri!user,
groupFilter:cons!USER_GROUP
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
venkateshs329
over 7 years ago
in reply to
jayashrib223
AFAIK Call getgroupsformemberuser() function In process model Script TASK AND Assignment should be whoever designed the process , These particular node will execute under designer context
and we can able to call getgroupsformemberuser() function and pass Interface rule.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel