I’m stumped. I want to restrict users so they can only select certain values in a dialog list based on roles.
My database is a standard document library, but I only want members of the “Research” group to be able to post to the category “Research” and so on. I can’t think of a good way to do this.
Does anyone have any ideas?
Thanks,
Mike
Subject: Securing category choices
Set up a profile document that contains a field for each role. The field should be multivalue, Separate Values when User Enters = new line, Display Separate Values As = new line. Store the available choices for each role in the corresponding field.
Make your dialog choices based on a formula, and have the formula select the correct field off your profile document based on the user role.
For example, create a profile form called dbPrefs. Place a field called researchChoices on it. Use @Command([EditProfile]) from a view action (or anywhere) to actually create the document; add the choices to the field and save.
In the dialog list field, set it to Use Formula For Choices. In the formula box, use something like this:
@If(
@IsMember(“[Research]”; @UserRoles); @GetProfileField(“dbPrefs”; “researchChoices”);
@GetProfileField(“dbPrefs”; “defaultChoices”))
Subject: Securing category choices
This might be overkill but . . .
I’ve gotten into the habit of including a “keyword maintenance” function in all of my applications that allows the designated administrator of the database to add/update/inactivate keywords, set a keyword as a default, sort them in a specific order, etc. This way, they can tailor the keywords to whatever they want without needing to call me. All my keyword fields would look up to a single hidden “keyword lookup” view using a specific “keyword category” key.
If you have something similar set up, you could expand on that by including an extra option to allow the “administrator” to select the roles to be associated with that particular keyword. Upon saving the keyword document, a Readers field would be updated with the selected roles. The result would be, when a user retrieves the keywords from the lookup view, they will only get the ones that they “see” based on their roles.
Of course, if you don’t have a separate keyword maintenance already set up then this idea might be more labor intensive than it’s worth.
Hope that helps.