-
Notifications
You must be signed in to change notification settings - Fork 168
[backend/frontend] Manage players - permissions #4059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
checkUserAccess(userRepository, userId); | ||
User user = userRepository.findById(userId).orElseThrow(ElementNotFoundException::new); | ||
if (!currentUser().isAdmin() && user.isManager()) { | ||
if (!userService.currentUser().isAdminOrBypass() && user.isManager()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should be removed also, the rbac is enough
public Page<Organization> organizationPagination( | ||
@NotNull SearchPaginationInput searchPaginationInput) { | ||
User currentUser = userService.currentUser(); | ||
if (currentUser.isAdminOrBypass()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also remove the if here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is some logic to add in PermissionService also -> if resourceType - PLAYER or USER and userId is resourceId -> allow the call
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release/current #4059 +/- ##
=====================================================
- Coverage 47.23% 47.23% -0.01%
+ Complexity 3252 3247 -5
=====================================================
Files 840 840
Lines 25187 25148 -39
Branches 1819 1814 -5
=====================================================
- Hits 11898 11878 -20
+ Misses 12592 12578 -14
+ Partials 697 692 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Proposed changes
Testing Instructions
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...