diff options
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r-- | src/main/java/com/juick/service/UserService.java | 2 | ||||
-rw-r--r-- | src/main/java/com/juick/service/UserServiceImpl.java | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/juick/service/UserService.java b/src/main/java/com/juick/service/UserService.java index 4b1cd127..e1f53abb 100644 --- a/src/main/java/com/juick/service/UserService.java +++ b/src/main/java/com/juick/service/UserService.java @@ -126,4 +126,6 @@ public interface UserService { void updateLastSeen(User user); boolean isAdminUser(User user); + + boolean isServiceUser(User user); } diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java index 7d215260..1594936a 100644 --- a/src/main/java/com/juick/service/UserServiceImpl.java +++ b/src/main/java/com/juick/service/UserServiceImpl.java @@ -57,6 +57,9 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Value("${juick.admin_users:}") List<String> adminUsers; + @Value("${service_user:juick}") + private String serviceUser; + private class UserMapper implements RowMapper<User> { @Override public User mapRow(@Nonnull ResultSet rs, int rowNum) throws SQLException { @@ -663,4 +666,9 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { public boolean isAdminUser(User user) { return adminUsers.contains(user.getName()); } + + @Override + public boolean isServiceUser(User user) { + return user.getName().equals(serviceUser); + } } |