diff --git a/sonarQuest-backend/src/main/java/com/viadee/sonarquest/entities/Permission.java b/sonarQuest-backend/src/main/java/com/viadee/sonarquest/entities/Permission.java index 65018676..e81394a6 100644 --- a/sonarQuest-backend/src/main/java/com/viadee/sonarquest/entities/Permission.java +++ b/sonarQuest-backend/src/main/java/com/viadee/sonarquest/entities/Permission.java @@ -21,53 +21,53 @@ @Table(name = "Permission") public class Permission { - @JsonIgnore - @Id - @GeneratedValue - private Long id; - - @Enumerated(EnumType.STRING) - @Column(name = "type", nullable = false) - private PermissionType type; - - @Column(name = "permission", nullable = false) - private String permissionDescription; - - @JsonIgnore - @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(name = "Role_To_Permission", joinColumns = @JoinColumn(name = "permission_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "role_id", referencedColumnName = "id")) - private List roles; - - public Long getId() { - return id; - } - - public void setId(final Long id) { - this.id = id; - } - - public PermissionType getType() { - return type; - } - - public void setType(final PermissionType type) { - this.type = type; - } - - public String getPermissionDescription() { - return permissionDescription; - } - - public void setPermissionDescription(final String permission) { - permissionDescription = permission; - } - - public List getRoles() { - return roles; - } - - public void setRoles(final List roles) { - this.roles = roles; - } + @JsonIgnore + @Id + @GeneratedValue + private Long id; + + @Enumerated(EnumType.STRING) + @Column(name = "type", nullable = false) + private PermissionType type; + + @Column(name = "permission", nullable = false) + private String permission; + + @JsonIgnore + @ManyToMany(cascade = CascadeType.ALL) + @JoinTable(name = "Role_To_Permission", joinColumns = @JoinColumn(name = "permission_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "role_id", referencedColumnName = "id")) + private List roles; + + public Long getId() { + return id; + } + + public void setId(final Long id) { + this.id = id; + } + + public PermissionType getType() { + return type; + } + + public void setType(final PermissionType type) { + this.type = type; + } + + public String getPermission() { + return permission; + } + + public void setPermission(final String permission) { + this.permission = permission; + } + + public List getRoles() { + return roles; + } + + public void setRoles(final List roles) { + this.roles = roles; + } } diff --git a/sonarQuest-backend/src/main/java/com/viadee/sonarquest/services/UserService.java b/sonarQuest-backend/src/main/java/com/viadee/sonarquest/services/UserService.java index 6f78775c..96fd129f 100644 --- a/sonarQuest-backend/src/main/java/com/viadee/sonarquest/services/UserService.java +++ b/sonarQuest-backend/src/main/java/com/viadee/sonarquest/services/UserService.java @@ -47,7 +47,7 @@ public UserDetails loadUserByUsername(final String username) { final Set permissions = permissionService.getAccessPermissions(user); final List authoritys = permissions.stream() - .map(berechtigung -> new SimpleGrantedAuthority(berechtigung.getPermissionDescription())) + .map(berechtigung -> new SimpleGrantedAuthority(berechtigung.getPermission())) .collect(Collectors.toList()); return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), true,