com.day.cq.security.User Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aem-sdk-api Show documentation
Show all versions of aem-sdk-api Show documentation
The Adobe Experience Manager SDK
The newest version!
/*
* Copyright 1997-2008 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Day.
*/
package com.day.cq.security;
import javax.jcr.AccessDeniedException;
import java.security.NoSuchAlgorithmException;
import java.util.Iterator;
/**
* A User is an Authorizable that may Authenticate.
* This User authenticates by its Password.
* It therefor extends the Authorizable by a method to save a Password
*
* @see Authorizable
* @deprecated cq 5.5 Use org.apache.jackrabbit.api.security.user.User instead.
*/
public interface User extends Authorizable {
/**
* Grant an {@link Authorizable Authorizable} the privilege to impersonate
* as this User.
* NOTE: you can't grant impersonation from the User to the User itself.
* Implementations have to return false in this case.
*
* @param authorizable the Impersonation should be granted
* @return true if newly added.
* @throws javax.jcr.AccessDeniedException if privileges are not sufficient
*/
boolean grantImpersonation(Authorizable authorizable) throws AccessDeniedException;
/**
* Revoke the given {@link Authorizable Authorizanle} the privilege to
* impersonate as this {@link com.day.cq.security.User User}.
* NOTE: you can't revoke impersonation from the User to the User itself.
*
* @param authorizable to remove the Privilege
* @return true if tha given Authoirzable has had the privilege
* @throws javax.jcr.AccessDeniedException in case the caller does not the permission
* to perform this action
*/
boolean revokeImpersonation(Authorizable authorizable) throws AccessDeniedException;
/**
* Access all {@link Authorizable Authorizables} that are allowed to
* impersonate as this {@link com.day.cq.security.User User}.
* The collection will only contain the Authorizables the caller has permissions
* to read
*
* @return Authorizables allowed to impersonate as this User
*/
Iterator extends Authorizable> getImpersonators();
/**
* Return the Ids of all Authorizables that this User is allowed to impersonate
* as
*
* @return list of all IDs of User it may be allowed to sudo
*/
Iterator getSudoableUsers();
/**
* setPassword.
*
* @param password considered plain
* @param digest to use for encryption of the given password.
* @throws java.security.NoSuchAlgorithmException if the digest is not registered as a MessageDigest
* @throws javax.jcr.AccessDeniedException In case of missing permissions.
*/
@Deprecated
void setPassword(String password, String digest) throws NoSuchAlgorithmException, AccessDeniedException;
/**
* changePassword.
*
* @param password considered plain
*/
void changePassword(String password);
/**
* disable.
*
* @see org.apache.jackrabbit.api.security.user.User#disable(String)
* @since 5.4
* @param reason a {@link java.lang.String} object.
* @throws javax.jcr.RepositoryException if any.
*/
void disable(String reason) throws javax.jcr.RepositoryException;
/**
* isDisabled.
*
* @see org.apache.jackrabbit.api.security.user.User#isDisabled()
* @since 5.4
* @return a boolean.
* @throws javax.jcr.RepositoryException if any.
*/
boolean isDisabled() throws javax.jcr.RepositoryException;
/**
* getDisabledReason.
*
* @see org.apache.jackrabbit.api.security.user.User#getDisabledReason()
* @since 5.4
* @return a {@link java.lang.String} object.
* @throws javax.jcr.RepositoryException if any.
*/
String getDisabledReason() throws javax.jcr.RepositoryException;
}