Skip to content

Commit

Permalink
Simplify authentication check
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmarion committed Jan 23, 2025
1 parent 9555be3 commit 33de6c6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public void setHost(HostAndPort host) {
@Override
public MetricResponse getMetrics(TInfo tinfo, TCredentials credentials) throws TException {

if (!(ctx.getSecurityOperation().isSystemUser(credentials)
&& ctx.getSecurityOperation().authenticateUser(credentials, credentials))) {
if (!ctx.getSecurityOperation().authenticateUser(credentials, credentials)) {
throw new ThriftSecurityException(credentials.getPrincipal(),
SecurityErrorCode.PERMISSION_DENIED);
}
Expand Down

0 comments on commit 33de6c6

Please sign in to comment.