Correção de bugs e criação do termos de privacidade
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.agendaestudantil.seguranca;
|
||||
|
||||
import com.agendaestudantil.entidade.Estudante;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class DetalhesUsuarioPersonalizado implements UserDetails {
|
||||
|
||||
private final Estudante estudante;
|
||||
|
||||
public DetalhesUsuarioPersonalizado(Estudante estudante) {
|
||||
this.estudante = estudante;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return Collections.singleton(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return estudante.getSenha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return estudante.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user