Ryan1
Scholar

Restrict drop down options based off of current user?

Simple form with a list lookup used for the options of a drop down that shows categories. 

I have been asked to add an additional category that needs to be hidden unless users are in a specific AD group. 

Is this possible? 

Here are my thoughts so far:

User A (in the special AD group) - Sees 10 category options

User B (not in the specail AD group) - Sees 9 category options

Have two lookup lists (for categories) one with 10 and one with 9 and then validate the user to determine which lookup to use? 

Any help or recommendations will be greatly appreciated. 

Reply
7 Replies
emha
Collaborator

Re: Restrict drop down options based off of current user?

does it have to be AD group? it might be quite complicated to check AD group membership in forms.

it would be much easier with sharepoint group

considering SP group, basically you have two options

- either filter conditionally with 'Source view', like

fn-If(fn-IsMemberOfGroup('SpecialSPGroup'),'All Items','Limited Items')

- or filter conditionally by dedicated list fields which would denote items to show

fn-If(fn-IsMemberOfGroup('SpecialSPGroup'),'ItemsForSpecialGroup','ItemsForAllUsers')

Reply
fhunth
Scout

Re: Restrict drop down options based off of current user?

You can use the Inline function named fn-IsMemberOfGroup(groupname) and show differents controls(lookups) based on a rule.

Here you have a sample >>> http://nintexdownload.com/Nsupport/NF2010_Tutorial_How_to_show_hide_controls.pdf 

Reply
jackgelo
Contributor

Re: Restrict drop down options based off of current user?

Hi,

An other option you can look at, because the list of categories is small and you have a small number of items with a different visibility, is:

- in the category list, change permission for the special category and remove default groups and let it visible only for the special group (remember to keep also some administrator with full control, in case you need to change something for that item).

In this way, if a user isn't in the special group, when he open the dropdown tied to the lookup field, he can see only the items he can read.

As I've said at the beginning, this is an approach I suggest if there are only few special items, and this avoid to built some special rules in the Nintex Lookup Control filter parameter..in more complex scenario, Marian or Fernando approach is probably the best.

Giacomo

Reply
Ryan1
Scholar

Re: Restrict drop down options based off of current user?

Getting a strange error when applying this in the source view.

Please address the following:
  • View with name "fn-If(fn-IsMemberOfGroup('Operations Members'),'All Items','Special')" does not exist in List 31f4ff9b-3ef9-44c8-a2c9-4201710b1e05.

I can simply type in "Special" or "All Items" in the source view and it will only show the correct view in the drop down once published.

When I try to add the "IsMemberOfGroup" or "IsCurrentUser" I get the view error seen above.

Any ideas?

Reply
emha
Collaborator

Re: Restrict drop down options based off of current user?

what forms version are you on?

this should have been addressed with 2.9.3.0

  •    List Lookup control can now utilise functions in the Source View option (93384)
Reply
Ryan1
Scholar

Re: Restrict drop down options based off of current user?

We're on 2.9.0.0 so I'll have to update our forms. Hopefully that will resolve this issue. Thanks!

0 Kudos
Reply
cassymfreeman

Re: Restrict drop down options based off of current user?

I would say have item level permissions on your lookup list - the tenth option only being accessible to the specified ad group? 

Reply