aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/UserServiceImpl.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-04-26 09:34:29 +0300
committerGravatar Vitaly Takmazov2023-04-26 09:34:29 +0300
commitfc5f8e888c9ccfda7d739493c439437a917b9902 (patch)
treecb89cdb606b3296ef20c97b749a50d447b0d4a70 /src/main/java/com/juick/service/UserServiceImpl.java
parent90201606bb485988f5a85cd578f3f5b8ecddf4db (diff)
Expose 'isAdmin' user property over API
Diffstat (limited to 'src/main/java/com/juick/service/UserServiceImpl.java')
-rw-r--r--src/main/java/com/juick/service/UserServiceImpl.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java
index a7ea5c5f..442bd03c 100644
--- a/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/src/main/java/com/juick/service/UserServiceImpl.java
@@ -66,6 +66,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
}
user.setVerified(rs.getLong(6) > 0);
user.setPremium(rs.getInt(7) > 0);
+ user.setAdmin(adminUsers.contains(user.getName()));
return user;
}
}
@@ -595,11 +596,6 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
getJdbcTemplate().update("UPDATE users SET last_seen=? WHERE id=?", toDateTime(Instant.now().atOffset(ZoneOffset.UTC)), user.getUid());
}
- @Override
- public boolean isAdminUser(User user) {
- return adminUsers.contains(user.getName());
- }
-
@Transactional(readOnly = true)
@Override
public Optional<ExternalToken> getTwitterToken(final int uid) {