Federated roles #1856
Replies: 8 comments
-
RolesHere is a current breakdown of how we could use the tree structure to expand the roles. The tree structure can be used to break up roles to more manageable levels. This can help both the config developer as well as the Possible configuration: At the very top level of the workspace we could define the different
Note Workspace Config {
"templates": [],
"locales": {},
"roles": {
"level1": {
"name": "country",
"values": ["South Africa", "UK", "Germany"]
},
"level2": {
"name": "brand",
"values": ["KFC", "YUM", "BK"]
}
}
}Note locales (w/layers) Config {
"South Africa": {
"roles": {
"level1": {
"South Africa": true
}
},
"layers": {
"shoppertowns": {
"roles": {
"level2": {
"YUM": true,
"BK": {
"edit": true
}
}
}
}
}
},
"UK": {
"roles": {
"level1": {
"UK": true
}
},
"layers": {
"shoppertowns": {
"roles": {
"level2": {
"YUM": false,
"BK": {
"dataset": "reduced"
},
"KFC": {
"dataset": "full"
}
}
}
}
}
},
"Germany": {
"roles": {
"level1": {
"Germany": true
}
},
"layers": {
"shoppertowns": {
"roles": {
"level2": {
"YUM": false,
"BK": {
"dataset": "full"
},
"KFC": {
"dataset": "reduced"
}
}
}
}
}
}
} User (Rob👨)
├── South Africa <-- level1
│ └── BK <-- level2
├── UK
│ └── KFC
└── Germany
├── YUM
└── BK
const role = {
South Africa: {
BK: true
},
UK: {
KFC: true
},
Germany: {
YUM: true,
BK: true
}
};This is a table breaking down what Rob will have access to.
Caution There are things to consider with the tree structure. User with conflicting permissions: User
└── Germany
├── YUM
├── KFC
└── BK{
"Germany": {
"roles": {
"level1": {
"Germany": true
}
},
"layers": {
"shoppertowns": {
"roles": {
"level2": {
"YUM": {
"edit": true
},
"KFC": {
"edit": false
},
"BK": {
"edit": true
}
}
}
}
}
}
}The above is a problem because how can we know what property to apply if a user has all three.
|
Beta Was this translation helpful? Give feedback.
-
|
The requirements for this are as followed: There is an umbrella company who has 3 brands - Brand A, Brand B and Brand C. These brands operate across the world in lots of different countries. Some users only need to see the data for one brand and one country. However there are also a number of users who need to be able to see multiple brands (switch between them) and multiple countries. There is also an edit/read access to one data layer, only users with the edit role can change information on this layer. As an example:
|
Beta Was this translation helpful? Give feedback.
-
|
Any solution must be backwards compatible and should be build on the core concept of [template] object merging. A locale can defined as literal in the workspace.locales or through templates. The workspace.locale is the base for any locale in the workspace.locales. It is not feasible to create combination locales [ie europe-brand_a]. With multiple tiers and multiple options on each tier the number of possible combinations would quickly become unmaintanable. Nesting must not be limited to a tier. Nesting of locales can be achieved by providing a locales[] array in a locale. Any of the locales defined in the array are available to be merged. eg The brand_a and b locales are available for the us regional locale. The layers in the brand locales will be merged into the mapview locale in the mapp library. Brand locales will be accessible in accordance to their roles configuration. A locale may also have an extent which will be merged into the locale requesting an additional local configuration. For example the Europe locale has access to the UK locale which in turn has access to a set of brand locales. "locale": {
"layers": {
"common_layer": {}
}
},
"locales": {
"us": {
"roles": {
"us": {}
},
"extent": {},
"layers": {},
"locales": [
"brand_a_locale",
"brand_b_locale"
]
},
"europe": {
"roles": {
"europe": {}
},
"extent": {},
"layers": {},
"locales": [
"UK_locale",
"brand_b_locale",
"brand_c_locale"
]
}
}The templates object to support the locales[] array would look like this. "templates": {
"query": {
"roles": {}
},
"common_layer": {},
"finance_layer": {
"roles": {}
},
"brand_a_layer": {
"roles": {}
},
"brand_b_layer": {
"roles": {}
},
"brand_c_layer": {
"roles": {}
},
"brand_a_locale": {
"roles": {
"brand_a": {}
},
"layers": {
"brand_a_layer": {}
}
},
"brand_b_locale": {
"roles": {
"brand_b": {}
},
"layers": {
"brand_b_layer": {}
}
},
"brand_c_locale": {
"roles": {
"brand_c": {}
},
"layers": {
"brand_c_layer": {}
}
},
"UK_locale": {
"roles": {
"UK": {}
},
"extent": {},
"layers": {
"brand_c_layer": {}
}
}
}Roles may be defined in literals or templates. However a role structure may only be retrieved from literals. Loading every nested template from source would put too much stress on the workspace API. This can be enabled on a flag as file system [locale] templates are directly accessible and should never be cached. A literal role structure can also be provided as workspace.roles. This provides backwards compatibility as the roles config would only be used if available with the lookup for roles as fallback. "roles": {
"us": {
"brand_a": {},
"brand_b": {}
},
"europe": {
"brand_b": {},
"brand_c": {},
"uk": {
"brand_c": {}
}
},
"brand_a": {},
"brand_b": {},
"brand_c": {}
} |
Beta Was this translation helpful? Give feedback.
-
|
This first task from this is to enable reload of the mapview. https://github.com/GEOLYTIX/xyz/issues/1921 |
Beta Was this translation helpful? Give feedback.
-
|
This is the second task to be addressed after we are able to reload the mapview. #1922 |
Beta Was this translation helpful? Give feedback.
-
|
Requirement 2 - role management: An umbrella company operates across multiple different countries and regions - individual users can be assigned to a country (locale) to see data about a single country or a region, allowing them to see data for multiple countries (locales). As an example:
|
Beta Was this translation helpful? Give feedback.
-
|
The check for nested roles has been implemented in the PR linked to this ticket. #2099 @jfitzpatrick17 This will allow us to build an interface in a custom admin view. |
Beta Was this translation helpful? Give feedback.
-
|
@RobAndrewHurst Role profiles can already be implemented in a custom view interface. You can add a roles array to the workspace.roles. If selected in a custom interface any roles in the roles array will be appended to the User.roles array. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Roles need to be federated in a tree structure for fine grained access to resources.
Regions may be nested. A locale for London could be based on a locale for the UK which in turn could be based on a locale for Europe.
Roles need to reflect the depth of access to these nested regions.
Different brands / themes may accessible on these nested regions.
For example demographics or financial information could be two themes which are available on the different nested geographic locales.
Functionality can be limited by further roles, like viewer or editor.
This can not work by combining roles eg.
europe-uk-london-demographics-editoras there would be an exponential number of possible combinations.This can only work in a object structure.
Roles apply to the same level or down the tree from siblings.
Beta Was this translation helpful? Give feedback.
All reactions