remove current user check, because it does not work with apache shiro

This commit is contained in:
Sebastian Sdorra
2012-10-04 10:50:57 +02:00
parent 468f1a9b4c
commit 4d3c12c805

View File

@@ -174,9 +174,7 @@ public class DefaultUserManager extends AbstractUserManager
throw new ScmSecurityException("user is not authenticated"); throw new ScmSecurityException("user is not authenticated");
} }
User currentUser = subject.getPrincipals().oneByType(User.class); if (!subject.hasRole(Role.ADMIN))
if (!user.equals(currentUser) &&!subject.hasRole(Role.ADMIN))
{ {
throw new ScmSecurityException("admin account is required"); throw new ScmSecurityException("admin account is required");
} }