Commit 63ff79bc by Jan Hrabal

x

parent b6244184
...@@ -9,6 +9,7 @@ import org.springframework.util.StringUtils; ...@@ -9,6 +9,7 @@ import org.springframework.util.StringUtils;
import com.jh.boot.jpa.AbstractHibernateRepository; import com.jh.boot.jpa.AbstractHibernateRepository;
import com.jh.boot.security.PasswordHash; import com.jh.boot.security.PasswordHash;
import com.jh.boot.security.PasswordUtils; import com.jh.boot.security.PasswordUtils;
import com.jh.boot.security.model.AppRole;
import com.jh.boot.security.model.AppUser; import com.jh.boot.security.model.AppUser;
import com.jh.boot.security.model.ResetPasswordToken; import com.jh.boot.security.model.ResetPasswordToken;
...@@ -75,4 +76,9 @@ public class AppUserRepository extends AbstractHibernateRepository { ...@@ -75,4 +76,9 @@ public class AppUserRepository extends AbstractHibernateRepository {
return singleResult(q); return singleResult(q);
} }
public AppRole findRole(String name) {
Query q = entityManager.createQuery("select ar from AppRole ar where lower(ar.name) = :name");
q.setParameter("name", name.trim().toLowerCase());
return singleResult(q);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment