Filtering applications in MyApps

Overview

Filtering out applications, based on who is logging in, can be done by manually changing the configuration through the advanced view.

Please make sure to have a recent copy of the file phenix-store.json before doing any changes.

Prerequisites

Myapps configured through guide and running on version 3.0 or later.

The incoming assertion MUST contain the value "roles" as attribute. 

Example:

Create a valve for filtering

In the Configuration Manager, click the Advanced tab and find "Pipe valves" in the end of the list.

Add the following valve.

{
	"name": "ItemRemoveValve",
	"id": "appsfiltering",
	"enabled": "true",
	"config": {
		"item_include_expr": "item.containsProperty('requires_role') && item.getPropertyValue('requires_role') !== '' && !session.isUserInRole(item.getPropertyValue('requires_role'))"
	}
}
Click to copy

Update the Pipe providing list of applications

Now go to "Pipes" and locate the pipe with the alias myappsLookUpPipe. Insert the new valve reference in the valve_refs list, as valve number 5 from the end. Like this example:

{
	"valve_refs": "ec07d7ca-bb2e-4420-883a-d9b148d6c1fe,6f1c5c0d-479f-49b6-9274-348da7047fbc,552ac3d4-0ae7-40b9-a4fd-f16db92e9a1c,9693ab6f-f1c4-4454-a038-707ffe82ef43,appsfiltering,1f1dcc29-cee4-4c5a-a5f4-8a38629579df,ac32d0aa-c326-47c9-a556-fab1988e6836,02f8aab9-3a34-4316-9791-b42062aa801d,232d4a2f-5f66-4a9f-8a76-dcc307065acf"
}
Click to copy

Configure filtering

Locate the app valve you wish to apply filtering to.

In the config section add a requires_role attribute and set value to a corresponding "roles" value in the incoming assertion. 

Example rom Advanced tab:

{
	"name": "CreateApplicationValve",
	"config": {
		"id": "1",
		"title": "PhenixID Home",
		"information": "PhenixID on the web",
		"URL": "https://www.phenixid.se/",
		"requires_role": "anders"
	},
	"id": "d4992af7-ab3e-4ade-b3d9-4cce5140cac1",
	"guide_ref": "b7219541-c19c-4aaf-9f27-96fc3dcf6412",
	"pipe_ref": "1e31da53-15f6-4673-b930-fec30bfdc9b1",
	"created": "2020-06-03T08:56:14.299Z",
	"modified": "2020-06-03T09:45:53.058Z"
},
Click to copy

Example from Scenarios/Applications/MyApps: