|
@@ -118,6 +118,8 @@ public class SecurityUtils
|
|
|
*/
|
|
|
public static boolean isAdmin(Long userId)
|
|
|
{
|
|
|
- return userId != null && 1L == userId;
|
|
|
+ LoginUser user= (LoginUser) getAuthentication().getPrincipal();
|
|
|
+ return user != null && "admin".equals(user.getUser().getUserName());
|
|
|
+ // return userId != null && 1L == userId;
|
|
|
}
|
|
|
}
|