Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix Set missing property createdAt
Browse files Browse the repository at this point in the history
  • Loading branch information
tklein1801 committed Dec 17, 2023
1 parent 628b076 commit fbe7be6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main/java/de/budgetbuddy/backend/auth/AuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import de.budgetbuddy.backend.user.role.Role;
import de.budgetbuddy.backend.user.role.RolePermission;
import jakarta.servlet.http.HttpSession;
import org.apache.coyote.Response;
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
import org.mindrot.jbcrypt.BCrypt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/budgetbuddy/backend/user/role/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ public Role(String name, String description, RolePermission permissions) {
this.name = name;
this.description = description;
this.permissions = permissions.getPermissions();
this.createdAt = new Date();
}

public Role(String name, String description, Integer permissions) {
this.name = name;
this.description = description;
this.permissions = permissions;
this.createdAt = new Date();
}

public Role(RolePermission role) {
this.id = role.getId();
this.name = role.name();
this.permissions = role.getPermissions();
this.createdAt = new Date();
}

public boolean isGreaterOrEqualThan(RolePermission role) {
Expand Down

0 comments on commit fbe7be6

Please sign in to comment.