Skip to content

Conversation

@arogachev
Copy link
Contributor

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

@arogachev arogachev self-assigned this Feb 13, 2024
@arogachev arogachev added the type:enhancement Enhancement label Feb 13, 2024
@arogachev arogachev added this to the 2.0 milestone Feb 13, 2024
@what-the-diff
Copy link

what-the-diff bot commented Feb 13, 2024

PR Summary

  • Refactored Manager.php for improved permission checks

    • The refactoring introduces a new parameter for more fine-grained control over user permissions. Now, the system can also return false when asked if a non-permission item type has an authorization, helping prevent misuse of roles or access checks. This change also simplifies some logic by utilizing item instead of permission, making the code cleaner to understand.
  • Adjusted ManagerConfigurationTestTrait.php to support new permission check behaviour

    • Adapted the methods to incorporate the newly created parameter enhancing the testing suite. The createManager method and constructor were updated to accept and pass the new parameter, ensuring that all parts of the software can operate with these updated permissions checks.
  • Enhanced ManagerLogicTestTrait.php with additional test method

    • This test method, testUserHasPermissionWithRoleNotAllowed, validates the new feature where permission checks can be limited to only permissions and not roles. The additional test assertion ensures the changes work as expected, adding reliability to the implementation.
  • Tuned ManagerConfigurationTestTrait.php for aligned manager creation

    • The createFilledManager method under ManagerConfigurationTestTrait.php got updated to pass the new parameter. This change ensures that even complex managers created during tests are using the updated permissions checks, keeping tests accurate and trustworthy.

@arogachev arogachev marked this pull request as ready for review February 14, 2024 07:11
arogachev and others added 2 commits February 14, 2024 13:11
…-has-role

# Conflicts:
#	tests/Common/ManagerConfigurationTestTrait.php
@codecov
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (28c9f1e) to head (2637afb).

❗ Current head 2637afb differs from pull request most recent head 529e8a6. Consider uploading reports for the commit 529e8a6 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #254   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
+ Complexity       220       219    -1     
===========================================
  Files             14        13    -1     
  Lines            550       546    -4     
===========================================
- Hits             550       546    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arogachev arogachev requested a review from a team February 14, 2024 07:13
@arogachev arogachev added the status:code review The pull request needs review. label Feb 14, 2024
…-has-role

# Conflicts:
#	tests/Common/ManagerConfigurationTestTrait.php
# Conflicts:
#	tests/Common/ManagerConfigurationTestTrait.php
#	tests/Common/ManagerLogicTestTrait.php
@arogachev
Copy link
Contributor Author

The changes have been synced with main branch.

@arogachev arogachev merged commit 63e912e into master Feb 26, 2024
@arogachev arogachev deleted the 251-user-has-role branch February 26, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review. type:enhancement Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow checking for user's roles in ManagerInterface::userHasPermission()

4 participants