Add proper acl permissions implementation#32
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a proper ACL permissions mapping system by creating a list of permissions for all groups based on ACLs from the database.
- Introduces a new PermissionGroupAcls constants class to hold ACL strings
- Implements a Mapper from PermissionGroup to ACL and vice versa
- Integrates the mapping in FamilyGroupMember creation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| FamilyVaultServer/Utils/PermissionGroupToAclMapper.cs | Maps PermissionGroup enum values to ACL strings via constants |
| FamilyVaultServer/Utils/PermissionGroupAcls.cs | Defines ACL constants for each PermissionGroup |
| FamilyVaultServer/Utils/AclToPermissionGroupMapper.cs | Maps ACL strings back to PermissionGroup enum values |
| FamilyVaultServer/Models/FamilyGroupMember.cs | Uses the new AclToPermissionGroupMapper to set PermissionGroup value |
Comments suppressed due to low confidence (2)
FamilyVaultServer/Utils/PermissionGroupToAclMapper.cs:17
- [nitpick] Consider revising the error message to be more descriptive and grammatically correct, for example: "Invalid PermissionGroup provided."
_ => throw new ArgumentException("Provided not valid PermissionGroup"),
FamilyVaultServer/Utils/AclToPermissionGroupMapper.cs:17
- [nitpick] Consider revising the error message for clarity, e.g., "Invalid ACL value provided."
_ => throw new ArgumentException("Provided not valid ACL"),
167dfe5 to
5ea286f
Compare
pawl0wski
approved these changes
Apr 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Utworzyłem listę uprawnień dla wszystkich grup w naszej aplikacji oraz poprawne ich przydzielanie na podstawie ich ACL z bazy danych.