-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#121 | refactor: Self Role Application Operations Have Been Separated…
… with `RoleSelfApplicationController` and Permissions Have Been Renamed
- Loading branch information
1 parent
5780850
commit 7ff93d5
Showing
3 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
37 changes: 37 additions & 0 deletions
37
...ava/org/gelecekbilimde/scienceplatform/auth/controller/RoleSelfApplicationController.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.gelecekbilimde.scienceplatform.auth.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.gelecekbilimde.scienceplatform.auth.service.RoleApplicationService; | ||
import org.gelecekbilimde.scienceplatform.common.model.response.SuccessResponse; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Validated | ||
@RestController | ||
@RequestMapping("/api/v1") | ||
@RequiredArgsConstructor | ||
class RoleSelfApplicationController { | ||
|
||
private final RoleApplicationService roleApplicationService; | ||
|
||
|
||
@PostMapping("/role-application/self/author") | ||
@PreAuthorize("hasAnyAuthority('role:application:create:self:author')") | ||
SuccessResponse<Void> createAuthorApplication() { | ||
|
||
roleApplicationService.createAuthorApplication(); | ||
return SuccessResponse.success(); | ||
} | ||
|
||
@PostMapping("/role-application/self/moderator") | ||
@PreAuthorize("hasAnyAuthority('role:application:create:self:moderator')") | ||
SuccessResponse<Void> createModeratorApplication() { | ||
|
||
roleApplicationService.createModeratorApplication(); | ||
return SuccessResponse.success(); | ||
} | ||
|
||
} |
This file contains 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