diff --git a/li.strolch.privilege/src/main/java/li/strolch/privilege/model/UserRep.java b/li.strolch.privilege/src/main/java/li/strolch/privilege/model/UserRep.java index 995f28e3e..f1917e729 100644 --- a/li.strolch.privilege/src/main/java/li/strolch/privilege/model/UserRep.java +++ b/li.strolch.privilege/src/main/java/li/strolch/privilege/model/UserRep.java @@ -213,6 +213,18 @@ public class UserRep implements Serializable { this.roles = roles; } + /** + * Returns true if this user has the given role + * + * @param role + * the role to check for + * + * @return returns true if this user has the given role + */ + public boolean hasRole(String role) { + return this.roles.contains(role); + } + /** * @return the locale */