package com.srh.api.model; import lombok.Data; import org.springframework.security.core.GrantedAuthority; import javax.persistence.*; import java.util.List; @Entity @Data public class Profile implements GrantedAuthority { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String name; @ManyToMany private List apiUsers; @Override public String getAuthority() { return this.name; } }