Merge ffa349ce1c
into d074573de0
commit
105a76f7e7
|
@ -19,17 +19,19 @@ package org.mitre.oauth2.model.convert;
|
|||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Converter;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
@Converter
|
||||
public class SimpleGrantedAuthorityStringConverter implements AttributeConverter<SimpleGrantedAuthority, String> {
|
||||
public class SimpleGrantedAuthorityStringConverter implements AttributeConverter<GrantedAuthority, String> {
|
||||
|
||||
@Override
|
||||
public String convertToDatabaseColumn(SimpleGrantedAuthority attribute) {
|
||||
public String convertToDatabaseColumn(GrantedAuthority attribute) {
|
||||
if (attribute != null) {
|
||||
return attribute.getAuthority();
|
||||
} else {
|
||||
|
@ -38,7 +40,7 @@ public class SimpleGrantedAuthorityStringConverter implements AttributeConverter
|
|||
}
|
||||
|
||||
@Override
|
||||
public SimpleGrantedAuthority convertToEntityAttribute(String dbData) {
|
||||
public GrantedAuthority convertToEntityAttribute(String dbData) {
|
||||
if (dbData != null) {
|
||||
return new SimpleGrantedAuthority(dbData);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue