Skip to content

Commit

Permalink
Bug: Permission renaming rolled back
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph-Meyer committed Feb 27, 2019
1 parent f648c3c commit 3e1e00c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Role> 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<Role> getRoles() {
return roles;
}

public void setRoles(final List<Role> 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<Role> 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<Role> getRoles() {
return roles;
}

public void setRoles(final List<Role> roles) {
this.roles = roles;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public UserDetails loadUserByUsername(final String username) {
final Set<Permission> permissions = permissionService.getAccessPermissions(user);

final List<SimpleGrantedAuthority> 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,
Expand Down

0 comments on commit 3e1e00c

Please sign in to comment.