Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package rs.ac.uns.ftn.informatika.spring.security.model;
  2.  
  3. import com.fasterxml.jackson.annotation.JsonIgnore;
  4. import org.springframework.security.core.GrantedAuthority;
  5.  
  6. import javax.persistence.*;
  7.  
  8. @Entity
  9. @Table(name="AUTHORITY")
  10. public class Authority implements GrantedAuthority {
  11.  
  12. private static final long serialVersionUID = 1L;
  13.  
  14. @Id
  15. @Column(name="id")
  16. @GeneratedValue(strategy = GenerationType.IDENTITY)
  17. Long id;
  18.  
  19. @Column(name="name")
  20. String name;
  21.  
  22. @Override
  23. public String getAuthority() {
  24. return name;
  25. }
  26.  
  27. public void setName(String name) {
  28. this.name = name;
  29. }
  30.  
  31. @JsonIgnore
  32. public String getName() {
  33. return name;
  34. }
  35.  
  36. @JsonIgnore
  37. public Long getId() {
  38. return id;
  39. }
  40.  
  41. public void setId(Long id) {
  42. this.id = id;
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement