@SuppressWarnings( "nls" ) @Override public String toString() { return "MagicPrincipal [name=" + getName() + "]"; }
/** * Creates an ACE that gives full access to the owner. * <p/> * <p> Modifications to this ACL are not persisted. </p> */ protected void addOwnerAce( final String owner, final ACLTemplate acl ) throws RepositoryException { Principal ownerPrincipal = systemSession.getPrincipalManager().getPrincipal( owner ); if ( ownerPrincipal != null ) { Principal magicPrincipal = null; if ( ownerPrincipal instanceof Group ) { magicPrincipal = new MagicGroup( JcrTenantUtils.getTenantedUser( ownerPrincipal.getName() ) ); } else { magicPrincipal = new MagicPrincipal( JcrTenantUtils.getTenantedUser( ownerPrincipal.getName() ) ); } // unfortunately, we need the ACLTemplate because it alone can create ACEs that can be cast successfully // later; // changed never persisted acl.addAccessControlEntry( magicPrincipal, new Privilege[] { systemSession.getAccessControlManager() .privilegeFromName( "jcr:all" ) } ); //$NON-NLS-1$ } else { // if the Principal doesn't exist anymore, then there's no reason to add an ACE for it if ( log.isDebugEnabled() ) { log.debug( "PrincipalManager cannot find owner=" + owner ); //$NON-NLS-1$ } } }
new MagicPrincipal( JcrTenantUtils.getTenantedUser( PentahoSessionHolder.getSession().getName() ) );
: new MagicPrincipal( entry.getPrincipalName() ), privs.toArray( new Privilege[privs.size()] ) ) ) {
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } MagicPrincipal other = (MagicPrincipal) obj; if ( getName() == null ) { if ( other.getName() != null ) { return false; } } else if ( !getName().equals( other.getName() ) ) { return false; } return true; }