Skip to main content

Feature Policy 🆕

A feature policy variable contains information about which features in the Web Portal that users can see

Introduction​

Feature Policy variables are used to restrict access to certain features within the platform, thereby focussing users on the tasks they need to perform.

Defining a Feature Policy​

Below is a table with all the properties of a feature policy:

NameTypeExampleDescription
_idStringRunAllReportsThe unique id for this policy
categoryStringTeamUsersAn optional category used for filtering policies
descriptionStringMy test policyA descriptive name for the policy
enabledBooleantrueTrue if it is enabled, false to disable it, by default the policy is enabled
denyBooleanfalseBy default, all features are available to everyone, so you need to set this to false to deny access to features
membersListuser@company.comThe user emails or Azure Active Directory group id's this policy applies to
featuresList["scripts"]The list of features that this policy applies to

Methods​

A policy has the following methods:

NameDescriptionReturn Type
addMember(name)Adds a member to this policyvoid
removeMember(name)Removes a member from this policyvoid

Example policy definition:

{
"_id": "HideScripts",
"category": "TradingTeam",
"description": "Hide Scripts menu item from users",
"deny": true,
"members": [
"user@company.com"
],
"features": [
"scripts"
],
"enabled": true
}

Portal Feature Names​

The following table shows the names of the features for each portal item:

NamePortal Item
masterDataMaster Data
dataData
eventsEvents
smartDataSmart Data
geoDataGEO Data
reportsReports
curvesCurves
datasetsDatasets
processesprocesses
executionsExecutions
processTimelineProcess Timeline
dataPackagesData Packages
queuesQueues
subscriptionsSubscriptions
typesTypes
calendarsCalendars
scriptsScripts
dashboardsDashboards
alertsAlerts

Updating, Finding and Deleting Feature Policies​

Saving a feature policy​

To save a feature policy in OpenDataDSL code, use the save command as follows:

HideScripts = FeaturePolicy()
HideScripts.description = "Hide Scripts menu item from users"
HideScripts.features = ["scripts"]
HideScripts.addMember("39c6cccd-d6ea-4ac1-b564-8e4d1e28d75d")
HideScripts.deny = true
HideScripts.enabled = true
save HideScripts

Listing feature policies​

To find feature policies, you use the ODSL find command, e.g.

policies = find ${policy} where _type="FeaturePolicy"

You can use the unique keyword to just get all the ids of your policies, e.g.

find unique _id from ${policy} where _type="FeaturePolicy"

Retrieving a specific feature policy​

To get a specific named feature policy, you use the policy active variable. You can then examine the information on the policy, e.g.

p = ${policy:"HideScripts"}
print p.description

Disabling a feature policy​

You can disable a feature policy by setting the enabled flag to false, e.g.

p = ${policy:"HideScripts"}
p.enabled = false
save p

Deleting a feature policy​

To delete a feature policy, you issue the delete command, e.g.

delete ${policy:"HideScripts"}