-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add and delete functionality for Roles (#509)
* Add and delete functionality for Roles * Added Exception for deleting the user Role * Inverted if statement and reformatted tests
- Loading branch information
1 parent
a12f54e
commit d54ba89
Showing
7 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/java/ch/wisv/areafiftylan/exception/CannotRemoveUserRoleException.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,9 @@ | ||
package ch.wisv.areafiftylan.exception; | ||
|
||
import ch.wisv.areafiftylan.users.model.Role; | ||
|
||
public class CannotRemoveUserRoleException extends AreaFiftyLANException { | ||
public CannotRemoveUserRoleException(Role role) { | ||
super("Role " + role.name() + " cannot be removed"); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/ch/wisv/areafiftylan/users/model/RoleDTO.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,14 @@ | ||
package ch.wisv.areafiftylan.users.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
@Getter | ||
@Setter | ||
public class RoleDTO { | ||
|
||
@NotNull | ||
private Role role; | ||
} |
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
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
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
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