Class BambooAcegiSecurityUtils

java.lang.Object
com.atlassian.bamboo.security.acegi.BambooAcegiSecurityUtils

public class BambooAcegiSecurityUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Comparator<org.acegisecurity.acls.sid.Sid>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    hasAuthority(@NotNull org.acegisecurity.Authentication authentication, @NotNull org.acegisecurity.GrantedAuthority checkedAuthority)
     
    static boolean
    hasAuthority(org.acegisecurity.GrantedAuthority[] authorities, @NotNull org.acegisecurity.GrantedAuthority checkedAuthority)
     
    static boolean
    hasAuthority(org.acegisecurity.userdetails.UserDetails userDetails, @NotNull org.acegisecurity.GrantedAuthority checkedAuthority)
     
    static boolean
    isGranted(@NotNull org.acegisecurity.acls.Acl acl, @NotNull BambooPermission permission, @NotNull org.acegisecurity.acls.sid.Sid sid)
    Check if permission is explicitly granted to the given sid on an ACL object.
    static Comparator<org.acegisecurity.acls.sid.Sid>
    A comparator which can be used to construct tree-based collections for ACEGI Sids, for example a TreeSet.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SID_COMPARATOR

      public static final Comparator<org.acegisecurity.acls.sid.Sid> SID_COMPARATOR
  • Method Details

    • hasAuthority

      public static boolean hasAuthority(@NotNull @NotNull org.acegisecurity.Authentication authentication, @NotNull @NotNull org.acegisecurity.GrantedAuthority checkedAuthority)
    • hasAuthority

      public static boolean hasAuthority(org.acegisecurity.userdetails.UserDetails userDetails, @NotNull @NotNull org.acegisecurity.GrantedAuthority checkedAuthority)
    • hasAuthority

      public static boolean hasAuthority(org.acegisecurity.GrantedAuthority[] authorities, @NotNull @NotNull org.acegisecurity.GrantedAuthority checkedAuthority)
    • isGranted

      public static boolean isGranted(@NotNull @NotNull org.acegisecurity.acls.Acl acl, @NotNull @NotNull BambooPermission permission, @NotNull @NotNull org.acegisecurity.acls.sid.Sid sid)

      Check if permission is explicitly granted to the given sid on an ACL object.

      This method will not throw NotFoundException - instead, if the permission is missing, false will be returned.

      Parameters:
      acl - acl object
      permission - permission to check
      sid - sid to check
      Returns:
      true if permission is explicitly granted to sid, false otherwise
    • sidComparator

      public static Comparator<org.acegisecurity.acls.sid.Sid> sidComparator()
      A comparator which can be used to construct tree-based collections for ACEGI Sids, for example a TreeSet.

      Some Sid implementations don't have Sid.hashCode() implemented, which makes them unusable with hash-based collections like HashSet.