Full support for team based permissions in Ataccama ONE is coming in v14. However, you may need to implement team based permissions sooner than v14. This document is a guide to how you could achieve this in v13.8.
Background
Permissions in ONE can be configured as role based or user based. In most cases, configuration by role is preferred as it will usually be a one-time set up, where the role only needs to be configured once in the beginning, then any users allocated to that role will inherit all permissions on role.
The out of the box roles in ONE have some capabilities already allocated. These are auto-sharing permissions, which allows the role to have access to all items of that entity. E.g. Your role could have the capability of Rule Owner. This means the user will be automatically be owner of all rules that would ever be created on the platform.
But what if your user should only be owner to rules (or any other entities) within their team / division / domain?
As it stands in v13.8, these are the supported scenarios:
- user cannot create new rules, has access only to its rules
- Admin has to create the new rules, and assign permission for that role under specific rule
- user can create new rules, and see all rules in the whole platform
- Role is given rule-admin capability
- user cannot create new rules, but see all rules from all teams
- Role is given rule-editor or rule-viewer capability
In this article, we will explore the implementation for this case:
- user creates new rules, and has access to the team’s rules
- user creates a record in a new entity called
newRuleRequest
and publishes it - notification handler picks that up and creates new rule, allocating specific roles as owners and editors
- user creates a record in a new entity called
I have an example configuration here. These were my conditions:
- I have 2 departments:
HR
andFinance
- They have access to their own rules and own terms.
- There are 4 roles:
MMM_hr_lead
,MMM_hr_user
,MMM_finance_lead
,MMM_finance_user
1. New entities / properties in metadata model
You will need to create some new entities in ONE:
-
To hold list of your departments
- Each department should specify Owner roles and Editor roles
- The
ownerRole
andeditorRole
are Single Reference Entity onrole
. If you have a requirement, you can always set this as Array Embedded Entity.
-
To hold list of requests
- Each request should specify which department it is for
- You may need to add extra SRE property for sub types, e.g. for terms
- Hint: You could have created a
newRequest
entity with the common properties between the 2 entities, then createnewRuleRequest
which extendsnewRequest
, and alsonewTermRequest
which extendsnewRequest
but with extratermType
property termType
here is extra custom entity also
-
Add
department
andtermType
tovalueLists
entity as AEE- This allows the department and term type list to be visible in
List Of Values
menu inGlobal Settings
- This allows the department and term type list to be visible in
-
Add
newRuleRequest
/newTermRequest
/newRequest
(which ever you have chosen to implement) tometadata
node- This allows us to then put them in the navigation
- Optionally, you can also add new SRE property of
department
, on your actualrule
andterm
for easy reference, so it’s clear to the users which department the rule / term belongs to. It is not configured in this example.
2. Navigation
Once you have created the entities and properties in the metadata model, tidy up the navigation. Here, both of the requests were put into a Requests menu. A new section group navigation of Requests
was created as a child of Middle
, and then the new requests were created as children items inside of Requests
. You can of course organise this according to your needs.
3. Permissions.json
Permissions.json is in use for v13.8. This is the example that was implemented in this model. Do this only after all metadata model changes have been made because the permissions.json references the new entities.
Recommend that the example here is used to understand what changes are required, and then manually merged into your permissions.json file. Using this file directly will overwrite all previous changes made to your copy of the file.
Operation sets
- Set
core:createNewDraft
operations fornewRuleRequest
` andnewTermRequest
entities- line 1522:
rule-requester
- line 1539:
term-requester
- line 1522:
Capabilities
- line 1718, 1719: Add nodePaths of
"newRuleReuqest/**"
and"newTermRequest/**
as owner forapplication-user
capability - line 1723 - 1731: Add nothPath of
""
and operationSet of"rule-requester","term-requester"
toapplication-user
capability
4. Create users and roles, and allocate users to roles
The 4 new roles need to be created. Remember to create them in Keycloak, not in ONE directly. Remember they need to start with MMM_
.
5. Sync user and role
Go to ONE and sync user
6. Populate List of Values
Next, populate the Department and term types list.
When creating the department, allocate the roles who will get owner or editor access.
7. Orchestration project
The orchestration project consists of:
- notification handler
- This listens for all creations of
newTermRequest
andnewRuleRequest
, and triggers defined .ewf, with the event details in a json string
- This listens for all creations of
- workflow
- The workflow will pass that json string into defined .comp
- component
- The component takes the json message, and queries the
newRequest
entity for its details - Also queries the associated
department
androle
s - Check that the person who created the rule / term request has one of either the owner or editor role. If the person does have the role(s)…
- Write the rule or term. This is possible because it is now
MMM_admin
doing the write rule. Rule could be written by MMM Metadata Writer, but term need to be written by Graphql - More Graphql queries to set the
ownerRole
andeditorRole
- Delete the initial
newRequest
record, as it’s already been created - If the person does not have the role(s), the request would be updated with a timestamp and a message, notifying them that they do not have permissions and so need to delete the request and try again when they have the correct rights.
- The component takes the json message, and queries the
- runtime config. The connection details to ONE platform are defined as https://one.your.ataccama.domain. Adjust all the urls and credentials as required for your environments.
If your metadata model setup has deviated from the example (e.g. you named your entities differently, or you made extra properties), then remember you potentially need to change property references in all of the above files.
8. Tweak notification handler
The rule_creation.noth
notification handler file has this in line 11:
<subscription ackLimit="100" chunkMaxDelay="250" chunkSize="100" entityType="newRuleRequest" excludeOwnModifications="false" subscriptionId="896a55cf-0b3c-412e-b062-86351bca8b15"/>
You need to adjust it, so that there is no subscriptionId tag. This tag needs to be generated specifically for your ONE instance. ONE runtime server will generate it when it starts up:
<subscription ackLimit="100" chunkMaxDelay="250" chunkSize="100" entityType="newRuleRequest" excludeOwnModifications="false"/>
9. Ensure notification handler component is enabled in serverConfig
Ensure you have enabled the notification handler component in your serverConfig file. More docs here.
Deploy to your project to your runtime server and start it.
10. Test!
All configuration is now done!
To start with:
admin
user should see everythinghr_user1
should see nothing- Both
admin
andhr_user1
should see the new request menus
As hr_user1
:
- Create a new rule request
- Give it some description
- Indicate it should be for HR team
- Publish the rule
- Refresh the page, the new rule request should disappear
- Go to rule listing
- Should see your new rule there
- New rule should be allocated to
MMM_hr_lead
for Owner andMMM_hr_user
for Editor
As finance_user1
:
- Create a new rule request
- Give it some description
- Indicate it should be for HR team
- Publish the rule
- Refresh the page, the new rule request should be populated with log message and timestamp
- Go to rule listing
- New rule should not be there