Class AclObjectIdentity

java.lang.Object
ubic.gemma.core.security.acl.domain.AclObjectIdentity
All Implemented Interfaces:
Serializable, org.springframework.security.acls.model.ObjectIdentity

@Entity public class AclObjectIdentity extends Object implements org.springframework.security.acls.model.ObjectIdentity
Implementation of ObjectIdentity.
Version:
$Id: AclObjectIdentity.java,v 1.1 2013/09/14 16:55:18 paul Exp $
Author:
Paul
See Also:
  • Constructor Details

    • AclObjectIdentity

      public AclObjectIdentity()
    • AclObjectIdentity

      public AclObjectIdentity(Class<? extends Securable> javaType, Long identifier)
    • AclObjectIdentity

      public AclObjectIdentity(Securable object)
      If the object is a proxy, its superclass must be the correct one to give the OBJECT_CLASS (type) in the ACL tables. For polymorphic classes this will be a problem if the method returns the superclass, so use fetch all properties. Example: PhenotypeAssociationDao. See chapter 19.1.3 of the Hibernate documentation for an explanation about polymorphic classes and proxies.

      Renovations Phase 2: ClassUtils.getUserClass(Class) only unwraps CGLIB proxies (whose class names contain "$$"); Hibernate proxies use "$HibernateProxy$" (single $) and slip through unchanged, leaving the OID with a synthetic type like ExperimentalDesign$HibernateProxy$hm1xnISy that doesn't match the canonical class name Spring Security's BasicLookupStrategy compares against acl_class.class. Use Hibernate.getClass(Object) which handles HibernateProxy and then falls back to ClassUtils for CGLIB-only stacks.

    • AclObjectIdentity

      public AclObjectIdentity(String type, Long identifier)
  • Method Details

    • getId

      public Long getId()
    • setId

      public void setId(Long id)
    • getType

      public String getType()
      Specified by:
      getType in interface org.springframework.security.acls.model.ObjectIdentity
    • setType

      public void setType(String type)
    • getIdentifier

      public Long getIdentifier()
      Specified by:
      getIdentifier in interface org.springframework.security.acls.model.ObjectIdentity
    • setIdentifier

      public void setIdentifier(Long identifier)
    • getEntries

      public Set<AclEntry> getEntries()
    • setEntries

      public void setEntries(Set<AclEntry> entries)
    • getEntriesInheriting

      public boolean getEntriesInheriting()
    • setEntriesInheriting

      public void setEntriesInheriting(boolean entriesInheriting)
    • getObjectIdClass

      public Long getObjectIdClass()
    • setObjectIdClass

      public void setObjectIdClass(Long objectIdClass)
    • getOwnerSid

      public AclSid getOwnerSid()
    • setOwnerSid

      public void setOwnerSid(AclSid ownerSid)
      Set the owner from an AclSid entity (Hibernate-side).
    • setOwnerSidFromSpring

      public void setOwnerSidFromSpring(org.springframework.security.acls.model.Sid ownerSid)
      Set the owner from a Spring Security Sid. The legacy gsec AclImpl accepts a Spring sid through Spring's OwnershipAcl interface; this overload bridges that back to the Hibernate-mapped entity. Phase B of the gsec absorption split the Sid hierarchy cleanly: gsec entities are no longer Sid implementations, so the conversion has to happen here. The legacy AclImpl/AclDaoImpl stack is no longer wired in production (the aclService bean is now JdbcMutableAclService); this path remains for BaseDatabaseTest-based unit tests that still exercise the legacy stack.
    • getParentObject

      public AclObjectIdentity getParentObject()
    • setParentObject

      public void setParentObject(AclObjectIdentity parentObject)
    • hashCode

      public int hashCode()
      Important so caching operates properly.
      Specified by:
      hashCode in interface org.springframework.security.acls.model.ObjectIdentity
      Overrides:
      hashCode in class Object
      Returns:
      the hash
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface org.springframework.security.acls.model.ObjectIdentity
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object