| | |
| | | import org.opends.server.api.AccessControlHandler; |
| | | import static org.opends.server.authorization.dseecompat.AciMessages.*; |
| | | import org.opends.server.core.*; |
| | | import static org.opends.server.loggers.Debug.debugEnter; |
| | | import static org.opends.server.loggers.Error.logError; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.Modification; |
| | | import org.opends.server.types.ModificationType; |
| | | import org.opends.server.types.Privilege; |
| | | import org.opends.server.types.SearchResultEntry; |
| | | import org.opends.server.types.SearchResultReference; |
| | | import static org.opends.server.util.StaticUtils.toLowerCase; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | |
| | | public class AciHandler extends AccessControlHandler |
| | | { |
| | | |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.authorization.dseecompat.AciHandler"; |
| | | |
| | | /** |
| | | * ACI_ADD is used to set the container rights for a LDAP add operation. |
| | |
| | | * @return True if access is allowed. |
| | | */ |
| | | public boolean isAllowed(AddOperation operation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | AciLDAPOperationContainer operationContainer = |
| | | new AciLDAPOperationContainer(operation, ACI_ADD); |
| | | boolean ret=isAllowed(operationContainer,operation); |
| | |
| | | * @return True if access is allowed. |
| | | */ |
| | | public boolean isAllowed(CompareOperation operation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | |
| | | AciLDAPOperationContainer operationContainer = |
| | | new AciLDAPOperationContainer(operation, ACI_COMPARE); |
| | |
| | | * @return True if access is allowed. |
| | | */ |
| | | public boolean isAllowed(DeleteOperation operation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | AciLDAPOperationContainer operationContainer= |
| | | new AciLDAPOperationContainer(operation, ACI_DELETE); |
| | | return isAllowed(operationContainer, operation); |
| | |
| | | */ |
| | | |
| | | public boolean isAllowed(ModifyOperation operation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | AciLDAPOperationContainer operationContainer= |
| | | new AciLDAPOperationContainer(operation, ACI_NULL); |
| | | return aciCheckMods(operationContainer, operation, |
| | |
| | | */ |
| | | public boolean |
| | | maySend(SearchOperation operation, SearchResultEntry entry) { |
| | | assert debugEnter(CLASS_NAME, "maySend"); |
| | | AciLDAPOperationContainer operationContainer = |
| | | new AciLDAPOperationContainer(operation, |
| | | (ACI_READ | ACI_SEARCH), entry); |
| | |
| | | public SearchResultEntry filterEntry(SearchOperation operation, |
| | | SearchResultEntry entry) { |
| | | |
| | | assert debugEnter(CLASS_NAME, "filterEntry"); |
| | | AciLDAPOperationContainer operationContainer = |
| | | new AciLDAPOperationContainer(operation, |
| | | (ACI_READ | ACI_SEARCH), entry); |
| | |
| | | @Override |
| | | public boolean maySend(SearchOperation operation, |
| | | SearchResultReference reference) { |
| | | assert debugEnter(CLASS_NAME, "maySend"); |
| | | //TODO: Planned to be implemented. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean isAllowed(ModifyDNOperation modifyDNOperation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | // TODO: Planned to be implemented. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean isAllowed(BindOperation bindOperation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | //Not planned to be implemented. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean isAllowed(ExtendedOperation extendedOperation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | //Not planned to be implemented. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean isAllowed(SearchOperation searchOperation) { |
| | | assert debugEnter(CLASS_NAME, "isAllowed"); |
| | | //Not planned to be implemented. |
| | | return true; |
| | | } |