Skip to content

Commit

Permalink
fix serialization of permission.json
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Jun 19, 2024
1 parent c64a541 commit 862be7b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions sources/orthanc_auth_service/permissions.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
{
"roles": {
"admin-role": {
"authorized_labels": [
"authorized-labels": [
"*"
],
"permissions": [
"all"
"anonymize",
"delete",
"download",
"modify",
"send",
"share",
"view",
"settings",
"edit-labels",
"admin-permissions",
"upload",
"q-r-remote-modalities"
]
},
"doctor-role": {
"authorized_labels": [
"authorized-labels": [
"*"
],
"permissions": [
Expand All @@ -20,7 +31,7 @@
]
},
"external-role": {
"authorized_labels": [
"authorized-labels": [
"external"
],
"permissions": [
Expand All @@ -29,5 +40,5 @@
]
}
},
"allowed_labels": []
"allowed-labels": []
}
2 changes: 1 addition & 1 deletion sources/orthanc_auth_service/shares/roles_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def update_configured_roles(self, new_configuration: RolesConfigurationModel):

logging.warning(f"Writing the new roles and permissions to configuration file ({self._permissions_file_path})")
with open(self._permissions_file_path, "wt") as f:
f.write(self._configured_roles.model_dump_json(indent=2))
f.write(self._configured_roles.model_dump_json(indent=2, by_alias=True))

def get_role_configuration(self, user_roles: List[str]) -> RolePermissions:
configured_user_roles = []
Expand Down

0 comments on commit 862be7b

Please sign in to comment.