Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactoring hasAnyRoles method

  • Loading branch information...
commit 95ccd4ad2060a1227fb161b8f80705a4fa733113 1 parent 6c52e5f
lunserv lunserv authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 library/src/main/scala/shiro/utils.scala
6 library/src/main/scala/shiro/utils.scala
View
@@ -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}
Please sign in to comment.
Something went wrong with that request. Please try again.