From 03d42d6e6ccaee4ff9d2a0808e51e5f9f0dc18c3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 22 Aug 2021 06:55:37 +0300 Subject: ActivityPub: return Application profile for service user --- src/main/java/com/juick/service/UserService.java | 2 ++ src/main/java/com/juick/service/UserServiceImpl.java | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'src/main/java/com/juick/service') 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 adminUsers; + @Value("${service_user:juick}") + private String serviceUser; + private class UserMapper implements RowMapper { @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); + } } -- cgit v1.2.3