/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS
*/
/**
* This class provides an enumeration of the allowed rights.
*/
public enum EnumRight {
/**
* This enumeration is returned when the result of the right is "read".
*
* @see Aci#ACI_READ
*/
/**
* This enumeration is returned when the result of the right is "write".
*
* @see Aci#ACI_WRITE
*/
/**
* This enumeration is returned when the result of the right is "add".
*
* @see Aci#ACI_ADD
*/
/**
* This enumeration is returned when the result of the right is "delete".
*
* @see Aci#ACI_DELETE
*/
/**
* This enumeration is returned when the result of the right is "search".
*
* @see Aci#ACI_SEARCH
*/
/**
* This enumeration is returned when the result of the right is "compare".
*
* @see Aci#ACI_COMPARE
*/
/**
* This enumeration is returned when the result of the right is
* "selfwrite".
*
* @see Aci#ACI_SELF
*/
/**
* This enumeration is returned when the result of the right is "proxy".
*
* @see Aci#ACI_PROXY
*/
/**
* This enumeration is returned when the result of the right is "import".
*
* @see Aci#ACI_IMPORT
*/
/**
* This enumeration is returned when the result of the right is "export".
*
* @see Aci#ACI_EXPORT
*/
/**
* This enumeration is returned when the result of the right is "all".
*
* @see Aci#ACI_ALL
*/
/**
* The name of the right.
*/
/**
* Creates an enumeration of the right name.
* @param right The name of the right.
*/
}
/**
* Returns the string representation of the right.
*
* @return the string representation of the right
*/
return right;
}
/**
* Checks if the enumeration is equal to the right name.
* @param right The name of the right to check.
* @return True if the right is equal to the enumeration's.
*/
}
/**
* Creates an enumeration of the right name.
* @param right The name of the right.
* @return An enumeration of the right or null if the name is invalid.
*/
return t;
}
}
}
return null;
}
/**
* Returns bit mask associated with the specified right.
* @param right The right enumeration to return the mask for.
* @return The bit mask associated with the right.
*/
switch(right) {
case READ:
break;
case WRITE:
break;
case ADD:
break;
case DELETE:
break;
case SEARCH:
break;
case COMPARE:
break;
case ALL:
break;
case EXPORT:
break;
case IMPORT:
break;
case PROXY:
break;
case SELFWRITE:
break;
}
return mask;
}
/**
* Return the EnumRight corresponding to the provided rightsMask.
*
* @param rightsMask
* the rights mask for which to return the corresponding EnumRight
* @return EnumRight corresponding to the provided rightsMask.
*/
// Next 3 rights are not included in ALL for historical reasons.
// ALL already existed when they got added. For compatibility reasons
// with existing deployments, they were not included in ALL.
{
}
{
}
{
}
return results;
}
// the remaining rights are already included in ALL
{
}
{
}
{
}
{
}
{
}
{
}
{
}
return results;
}
/**
* Checks if the provided rights mask has the specified rights.
*
* @param rightsMask
* The rights mask to look into.
* @param rights
* The rights to check for.
* @return true if the rights mask has the specified rights, false
* otherwise.
*/
}
}