Add user-group permissions to query #3425
Open
+152
−24
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.
This pull request introduces enhancements to user group management and access permission handling. Key changes include the addition of constants for user group attributes, modifications to access permission queries to incorporate user group-based permissions, and updates to ensure proper verification of feature availability.
User Group Management Enhancements:
app/Constants/UsersUserGroupsConstants.php
: Added a new constants class to define table names and attribute identifiers for user groups, improving maintainability and consistency.Access Permission Handling:
app/Policies/AlbumQueryPolicy.php
: Updated thegetComputedAccessPermissionSubQuery
method to include user group-based permissions in access queries. This ensures permissions can be evaluated based on both individual users and their associated user groups.Feature Verification Updates:
app/Http/Resources/Rights/SettingsRightsResource.php
: Updated thecan_acess_user_groups
property in the constructor to use theVerify::check
method for verifying feature availability, ensuring robust validation.Namespace Additions:
app/Policies/AlbumQueryPolicy.php
: AddedUsersUserGroupsConstants
to the namespace for consistent referencing of user group-related constants.Dependency Inclusion:
app/Http/Resources/Rights/SettingsRightsResource.php
: AddedLycheeVerify\Verify
to imports to support feature verification logic.