/** * {@inheritDoc} */ @Override public LdapPrincipal getEffectivePrincipal() { if ( authorizedPrincipal != null ) { return authorizedPrincipal; } return session.getEffectivePrincipal(); }
/** * Returns {@link LdapPrincipal} of current context. * * @param opContext TODO * @return the authenticated principal */ public static LdapPrincipal getPrincipal( OperationContext opContext ) { return opContext.getSession().getEffectivePrincipal(); }
protected Dn getOperationPrincipal() throws LdapInvalidDnException { Principal principal = opContext.getSession().getEffectivePrincipal(); return opContext.getSession().getDirectoryService().getDnFactory().create( principal.getName() ); }
/** * Creates a new instance of UnbindOperationContext. * * @param session The session to use */ public UnbindOperationContext( CoreSession session ) { super( session, session.getEffectivePrincipal().getDn() ); setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND ) ); }
/** * Creates a new instance of UnbindOperationContext. * * @param session The session to use * @param unbindRequest The UnbindRequest to process */ public UnbindOperationContext( CoreSession session, UnbindRequest unbindRequest ) { super( session, session.getEffectivePrincipal().getDn() ); setRequestControls( unbindRequest.getControls() ); setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND ) ); }
public ServerContext getRootContext() throws NamingException { ServerContext ctx = null; try { ctx = new ServerLdapContext( getService(), getSession().getEffectivePrincipal(), new LdapName( "" ) ); } catch ( Exception e ) { JndiUtils.wrap( e ); } return ctx; } }
public boolean hasPermission( OperationContext opContext ) throws LdapException { Dn principalName = opContext.getSession().getEffectivePrincipal().getDn(); return principalName.equals( opContext.getSession().getDirectoryService().getAdminSession() .getAuthenticatedPrincipal().getDn() ); } }
/** * @see javax.naming.ldap.LdapContext#newInstance( * javax.naming.ldap.Control[]) */ public LdapContext newInstance( Control[] requestControls ) throws NamingException { ServerLdapContext ctx = null; try { ctx = new ServerLdapContext( getService(), getSession().getEffectivePrincipal(), JndiUtils.toName( getDn() ) ); } catch ( Exception e ) { JndiUtils.wrap( e ); } ctx.setRequestControls( requestControls ); return ctx; }
String adminDn = session.getEffectivePrincipal().getName();
String modifiersName = opContext.getSession().getEffectivePrincipal().getName(); String modifyTimestamp = DateUtils.getGeneralizedTime();
String adminDn = session.getEffectivePrincipal().getName();
+ requestor.getCoreSession().getEffectivePrincipal().getName() );
ctx = new ServerLdapContext( service, session.getEffectivePrincipal(), JndiUtils.toName( target ) );
ctx = new ServerLdapContext( service, session.getEffectivePrincipal(), JndiUtils.toName( target ) );
ctx = new ServerLdapContext( getService(), getSession().getEffectivePrincipal(), JndiUtils.toName( target ) );
Dn principalDn = requestor.getCoreSession().getEffectivePrincipal().getDn();
&& ( session.getEffectivePrincipal() != null ) && ( !session.isAnonymous() ) && ( !session.isAdministrator() ) )