|
@@ -295,7 +295,13 @@ public class LoginUser implements UserDetails
|
|
|
|
|
|
@Override
|
|
|
public Collection<? extends GrantedAuthority> getAuthorities() {
|
|
|
- return Collections.emptyList();
|
|
|
+ if (this.getStudent() != null){
|
|
|
+ List<SimpleGrantedAuthority> roleList = new ArrayList<SimpleGrantedAuthority>();
|
|
|
+ roleList.add(new SimpleGrantedAuthority("ROLE_STUDENT"));
|
|
|
+ return roleList;
|
|
|
+ }else {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|