Skip to content

Feature 2834/move required permission to services#2839

Merged
mkimberlin merged 13 commits intodevelopfrom
feature-2834/move-required-permission-to-services
Feb 5, 2025
Merged

Feature 2834/move required permission to services#2839
mkimberlin merged 13 commits intodevelopfrom
feature-2834/move-required-permission-to-services

Conversation

@ocielliottc
Copy link
Collaborator

@ocielliottc ocielliottc commented Jan 27, 2025

This PR has a lot in it. Most @RequiredPermission annotations have been moved from the controller to the services implementation. There are a few exceptions where there is either no associated service or the service is specifically related to roles and permissions and would cause an infinite loop during bean resolution.

The following permissions were introduced in order to remove calls to isAdmin() on the current user services.

  1. CAN_ADMINISTER_GUILDS
  2. CAN_ADMINISTER_TEAMS
  3. CAN_ADMINISTER_CHECKIN_DOCUMENTS
  4. CAN_VIEW_ALL_UPLOADED_HOURS
  5. CAN_ADMINISTER_FEEDBACK_ANSWER
  6. CAN_ADMINISTER_FEEDBACK_TEMPLATES
  7. CAN_ADMINISTER_FEEDBACK_REQUEST

There are some places where isAdmin() remains. From what I can tell, these services are not used anymore.

services/demographics/DemographicsServicesImpl.java
services/opportunities/OpportunitiesServicesImpl.java
services/question_category/QuestionCategoryServicesImpl.java
services/survey/SurveyServicesImpl.java
services/tags/entityTag/EntityTagServicesImpl.java
services/tags/TagServicesImpl.java
services/validate/crud/GuildCRUDValidator.java

These changes require that most calls to service implementations have a current user associated with them, including the check services. Some changes may be required to handle Service Accounts.

@mkimberlin mkimberlin merged commit 715e036 into develop Feb 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move @RequiredPermission from the controllers to the service implementations

2 participants