Conversation
Documentation build overview
40 files changed ·
|
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…implify role list Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…:FlexMeasures/flexmeasures into feat/security-permissions-more-detailled
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
|
Heads-up now that #2634 has merged: this branch's merge migration no longer merges all the heads.
The fix is to point the merge at the current head instead, so is the check, and it is quick. 🤖 Generated with Claude Code |
#2634 added c5e1a7b94d20 on top of b63a02d5e184, so the revision this branch merges was no longer a head and the database would have been left with two. The merge now names the current head instead. One conflict needed a choice rather than both sides: this branch turns a sensor page into a 403 for a user of another organisation, where main had grown assertions about which panels such a user is shown. A 403 answers that outright, so this branch's expectation stands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0129WrXeJ5gia2pctFH93BqC Signed-off-by: F.N. Claessen <claessen@seita.nl>
|
Brought this branch up to date with main in 1c94510, and fixed the migration heads as flagged above: One conflict needed a choice, and it is yours to confirm. In Worth a conscious look, because it is a policy change rather than a test detail: a user of another organisation currently can open such a page and simply sees fewer controls, and after this they cannot open it at all. If that is intended, it deserves a line in the changelog; if the page should stay readable with the controls hidden, then those assertions should come back and the scoped permission needs to allow the read. 32 tests pass across 🤖 Generated with Claude Code |
Description
From discussion #2577. Closes #2608. This PR makes more fine-grained roles and permissions, which enables the read-only access to some account's resources that was the main goal, but also brings access rights management to a better-defined level.
Roles (same as before, plus:
Permissions:
Added permissions (that were not part of the discussion):
edit-profilecovers a user changing their own profile.reset-passwordnames the existing reset action: users can reset their own password, and authorised account admins can reset passwords within their organisation.We could reduce this set by 3 if all
trigger-permissions are wrapped into onetrigger-calculationspermission, andedit-assetsincludesedit-flex-config.These 3 legacy permissions remain available to plugin ACLs:.
Roles define what the user's granted permissons are. ACLs define per resource if the grants apply to them (e.g. how a user with
adminrole differs from one withaccount-admin- they can only be admin on assets in their account). In some cases, our API is fine-tuning that, e-g- for consultants. That already happened before.Here is how
Role's newpermissionsproperty (aligning with Flask-Security practices maps from itself to permissions:You can see the three new roles getting a special set, while admins get all grants.
Felix’s scope rule is included: home roles apply in a user’s own organisation, while consultant applies through client organisation ACLs. Role.permissions is defined in code. The migration grants existing users member to preserve their former implicit access.
Roleaccount-memberrole to all existing users, and add new roles, and descriptions to all rolesdocumentation/changelog.rstThe db migration has no downgrade logic. We would have to persist member role associations on disk, I believe. Should we do that?
Look & Feel
How to test
Further Improvements