...
To use Grouper Custom UI, a group is configured with attributes
...
configure this in the grouper.properties or on the Miscellaneous → Custom UI screen
Then there is link in the More Actions menu if you have the custom UI attributes assigned on the group
...
If a user is a manager (READ/UPDATE), then they will be able to pull users up, see the screen they see, see the answers to all their variables, and enroll or unenroll those users
The configuration is used to be done with JSON from simple javabeans, here is an example, explained more later.
As the Grouper Admin, go to a group (maybe one where people can join/leave), and add attribute assignments. Add "customUi" to the group. Then "add metadata assignment" to the customUi assignment, add customUiTextConfigBeans, and customUiUserQueryConfigBeans. Add a value for each JSON bean. It is multivalued, so add as many as you need
Configuration attributes
The configuration is simple javabeans in JSON format. These JSON strings are assigned as attributes values on a Group (see example above).
User query config bean
These configs identify variables that can be used in the screen to conditionally set text, adjust email text, etc. They are set from some operation like checking a membership in a group or an LDAP or SQL call or something
The queries are of type: userQueryType which is from the enum: CustomUiUserQueryType:
- grouper: check a membership or privilege
- ldap: execute an ldap filter
- sql: run a sql query against grouper or another database
- expressionLanguage: some expression (could call java)
- azure: check an azure membership or user object
- zoom: check zoom api and make attributes available (added 2.5.35+)
The queries assign variables which must be prefixed with "cu_" for "Custom UI"
You can configure a default that will fill in values for all config beans (maybe useful if there are a bunch of similar ldap calls)
but now is done in grouper.properties configuration or from the UI. See the Atlassian Jira Custom UI example for the current way to configure
User query config bean
These configs identify variables that can be used in the screen to conditionally set text, adjust email text, etc. They are set from some operation like checking a membership in a group or an LDAP or SQL call or something
The queries are of type: userQueryType which is from the enum: CustomUiUserQueryType:
- grouper: check a membership or privilege
- ldap: execute an ldap filter
- sql: run a sql query against grouper or another database
- expressionLanguage: some expression (could call java)
- azure: check an azure membership or user object
- zoom: check zoom api and make attributes available (added 2.5.35+)
The queries assign variables which must be prefixed with "cu_" for "Custom UI"
You can configure a default that will fill in values for all config beans (maybe useful if there are a bunch of similar ldap calls)
Field | Type | Required for type | Optional for type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attributeDefId | String | expressionLanguage, grouper, sql | uuid of attribute def to | |||||||||||||
Field | Type | Required for type | Optional for type | Description | ||||||||||||
attributeDefId | String | expressionLanguage, grouper, sql | uuid of attribute def to look up | |||||||||||||
azureGroupId | String | azure | if hardcoding the uuid of group in azure | |||||||||||||
bindVar0 | String | sql | bind var for sql | |||||||||||||
bindVar0type | String | sql | bind var type in sql: string or integer | |||||||||||||
bindVar1 | String | sql | bind var for sql | |||||||||||||
bindVar1type | String | sql | bind var type in sql: string or integer | |||||||||||||
bindVar2 | String | sql | bind var for sql | |||||||||||||
bindVar2type | String | sql | bind var type in sql: string or integer | |||||||||||||
configId | String | azure, ldap, zoom | sql | id in grouper config for azure, ldap, or sql | ||||||||||||
enabled | Boolean | azure, expressionLanguage, grouper, ldap, sql, zoom | true or false if this var is enabled | |||||||||||||
errorLabel | String | azure, zoom | expressionLanguage, grouper, ldap, sql | label on screen for the error variable | ||||||||||||
fieldNames | String | grouper | comma separated privs in grouper, e.g. members, readers, admins, viewers, updaters, optins, optouts, groupAttrReaders, groupAttrUpdaters, creators, stemAdmins, stemAttrReaders, stemAttrUpdaters, attrReaders, attrUpdaters, attrDefAttrReaders, attrDefAttrUpdaters, attrOptins, attrOptouts, attrAdmins | |||||||||||||
forLoggedInUser | Boolean | azure, expressionLanguage, grouper, ldap, sql | true if should run this rule for the logged in user (if manager using screen), or by default its the user being acted on (which might be the user logged in) | |||||||||||||
groupId | String | azure, expressionLanguage, grouper, ldap, sql | group uuid to look up a group | |||||||||||||
groupName | String | azure, expressionLanguage, grouper, ldap, sql | group name to look up a group | |||||||||||||
label | String | azure, expressionLanguage, grouper, ldap, sql, zoom | label to see on screen when variables are displayed | |||||||||||||
ldapAttributeToRetrieve | String | ldap | which attribute in ldap to retrieve | |||||||||||||
ldapFilter | String | ldap | ldap filter to run | |||||||||||||
ldapSearchDn | String | ldap | if not using the default dn in connection, search in this dn | |||||||||||||
nameOfAttributeDef | String | expressionLanguage, grouper, sql | name of attribute definition to lookup | |||||||||||||
order | Integer | azure, expressionLanguage, grouper, ldap, sql, zoom | integer and rules will be ordered by this integer, when displayed on screen | |||||||||||||
query | String | sql | sql query to execute | |||||||||||||
script | String | expressionLanguage | azure(2.5.30+), zoom | EL expression to run | ||||||||||||
stemId | String | expressionLanguage, grouper, sql | uuid of stem to lookup | |||||||||||||
stemName | String | expressionLanguage, grouper, sql | name of stem to lookup | |||||||||||||
userQueryType | String | azure, expressionLanguage, grouper, ldap, sql, zoom | identify the type of query, enter either: azure, expressionLanguage, grouper, ldap, sql. dropdown. | variableToAssign | String | azure, expressionLanguage, grouper, ldap, sql, zoom | name of variable must start with cu_ if the value is "default" then each attribute value will be the default for any bean without that set where its a valid value. dropdown. you cant have two variables with the same name | variableToAssignOnError | String | azure, zoom | expressionLanguage, grouper, ldap, sql | name of variable to assign on error, must start with cu_variableType | String | expressionLanguage, grouper, ldap, sql, azure, zoom | type of variable: boolean, integer, string |
GSH script to generate a user query bean
Code Block |
---|
customUiUserQueryConfigBean = new edu.internet2.middleware.grouper.ui.customUi.CustomUiUserQueryConfigBean();
customUiUserQueryConfigBean.setVariableToAssign("cu_o365twoStepRequiredToEnroll");
customUiUserQueryConfigBean.setFieldNames("members");
customUiUserQueryConfigBean.setUserQueryType("grouper");
customUiUserQueryConfigBean.setVariableType("boolean");
customUiUserQueryConfigBean.setGroupName("penn:isc:ait:apps:O365:twoStepProd:o365_two_step_prod_policy");
customUiUserQueryConfigBean.setLabel("${textContainer.text['penn_o365twoStep_cu_o365twoStepRequiredToEnroll']}");
System.out.println(GrouperUtil.jsonConvertTo(customUiUserQueryConfigBean, false)); |
JSON which is generated
...
sql. dropdown. | ||||
variableToAssign | String | azure, expressionLanguage, grouper, ldap, sql, zoom | name of variable must start with cu_ if the value is "default" then each attribute value will be the default for any bean without that set where its a valid value. dropdown. you cant have two variables with the same name | |
variableToAssignOnError | String | azure, zoom | expressionLanguage, grouper, ldap, sql | name of variable to assign on error, must start with cu_ you cant have two variables with the same name |
variableType | String | expressionLanguage, grouper, ldap, sql, azure, zoom | type of variable: boolean, integer, string |
Examples
Default user query bean to set some LDAP settings
...
Code Block |
---|
customUiTextConfigBean = new edu.internet2.middleware.grouper.ui.customUi.CustomUiTextConfigBean(); customUiTextConfigBean.setCustomUiTextType(CustomUiTextType.instructions1.name()); customUiTextConfigBean.setIndex(10); customUiTextConfigBean.setScript("${cu_o365twoStepRequiredToEnroll}"); customUiTextConfigBean.setText("${textContainer.text['penn_o365twoStep_instructions_requiredToEnroll']}"); customUiTextConfigBean.setEndIfMatches(true); System.out.println(GrouperUtil.jsonConvertTo(customUiTextConfigBean, false)); |
JSON which is generated
Code Block |
---|
{ "variableToAssign":"cu_o365twoStepRequiredToEnroll", "fieldNames":"members", "userQueryType":"grouper", "variableType":"boolean", "groupName":"penn:isc:ait:apps:O365:twoStepProd:o365_two_step_prod_policy", "label":"${textContainer.text['penn_o365twoStep_cu_o365twoStepRequiredToEnroll']}", "order":40 } |
...