Skip to content

Commit

Permalink
Refactoring hasAnyRoles method
Browse files Browse the repository at this point in the history
  • Loading branch information
lunserv committed Sep 22, 2011
1 parent 6c52e5f commit 95ccd4a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions library/src/main/scala/shiro/utils.scala
Expand Up @@ -36,10 +36,8 @@ private[shiro] trait Utils {
def lacksPermission(permission: String) =
!hasPermission(permission)

def hasAnyRoles(roles: Seq[String]) = test { subject =>
roles.map(r => subject.hasRole(r.trim)
).contains(true)
}
def hasAnyRoles(roles: Seq[String]) =
roles exists (r => hasRole(r.trim))
}

import net.liftweb.common.{Box,Failure,Full}
Expand Down

0 comments on commit 95ccd4a

Please sign in to comment.