public class Groups extends MMObjectBuilder
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctions, GUI_INDICATOR, GUI_PARAMETERS, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, temporaryNodes, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunctionmaxNodesFromQuery, mmb, storageConnector, tableNamefunctions| Constructor and Description |
|---|
Groups() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
contains(MMObjectNode containingGroupNode,
int containedObject)
Checks wether group or user identified by number is contained by group (also indirectly)
|
protected boolean |
contains(MMObjectNode containingGroupNode,
int containedObject,
Set<Integer> recurse)
Checks wether group or user identified by number is contained by group.
|
boolean |
contains(MMObjectNode containingGroup,
MMObjectNode groupOrUser) |
boolean |
contains(MMObjectNode group,
User user)
Checks wether a a certain user is part of a certain group, either directly or indirectly.
|
boolean |
equals(MMObjectNode o1,
MMObjectNode o2)
Implements equals for nodes (this is in MMObjectBuilder because you cannot override MMObjectNode)
|
static Groups |
getBuilder() |
SortedSet<Integer> |
getGroups(int containedObject)
Returns all groups, which are (directly or indirectly) containing the given object (user/group)
|
int |
hashCode(MMObjectNode o)
Implements for MMObjectNode
|
void |
setDefaults(MMObjectNode node)
unused, ie untested
public void addGroup(User user, MMObjectNode group, Verify verify) {
for (Enumeration enumeration = user.getNode().getRelations(); enumeration.hasMoreElements();) {
MMObjectNode relation = getNode(((MMObjectNode)enumeration.nextElement()).getNumber());
if (relation.parent instanceof ContainsRel) {
MMObjectNode source = relation.getNodeValue("snumber");
MMObjectNode destination = relation.getNodeValue("dnumber");
if (destination.getNumber() == user.getNode().getNumber() && source.getBuilder() == this) {
MMObjectNode newRelation = ContainsRel.getBuilder().grantRightsTo(group, source);
verify.create(user, newRelation.getNumber());
}
}
}
}
|
String |
toString(MMObjectNode n)
Implements for MMObjectNode
|
addEventListener, addField, addLocalObserver, addRemoteObserver, broadcastChanges, checkAddTmpField, clearBlobCache, commit, create, createAlias, createAlias, createIfNotExists, delete, equals, executeFunction, executeFunction, fieldLocalChanged, getAncestors, getBlobCache, getClassName, getConfigFile, getConfigResource, getDataTypeCollector, getDBState, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEmptyNode, getField, getFieldNames, getFields, getFields, getFunction, getFunctionParameters, getFunctions, getGUIIndicator, getGUIIndicator, getGUIIndicator, getHTML, getInitParameter, getInitParameters, getInitParameters, getInternalVersion, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNodeFromCache, getNodeGUIIndicator, getNumber, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedInputStream, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hasField, hashCode, hostname_function, init, insert, insert, isExtensionOf, isNodeCached, isNull, isVirtual, loadInitParameters, newFunctionInstance, nodeLocalChanged, nodeRemoteChanged, notify, notify, preCommit, process, removeEventListener, removeField, removeLocalObserver, removeNode, removeRelations, removeRemoteObserver, removeSyncNodes, replace, safeCache, sendFieldChangeSignal, setDescription, setDescriptions, setFields, setInitParameter, setMaintainer, setPluralNames, setSearchAge, setSingularNames, setUniqueValue, setUniqueValue, setValue, setValue, setVersion, setXMLPath, shutdown, testValidData, toString, update, updateFields, wrapcount, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, sizeaddFunction, createParameters, getFunction, getFunctions, getFunctionValuepublic static Groups getBuilder()
public boolean contains(MMObjectNode group, User user)
public boolean contains(MMObjectNode containingGroup, MMObjectNode groupOrUser)
protected boolean contains(MMObjectNode containingGroupNode, int containedObject)
protected boolean contains(MMObjectNode containingGroupNode, int containedObject, Set<Integer> recurse)
public SortedSet<Integer> getGroups(int containedObject)
public void setDefaults(MMObjectNode node)
setDefaults in class MMObjectBuildernode - The node to set the defaults of.public String toString(MMObjectNode n)
MMObjectBuildertoString in class MMObjectBuilderpublic boolean equals(MMObjectNode o1, MMObjectNode o2)
MMObjectBuilderequals in class MMObjectBuilderpublic int hashCode(MMObjectNode o)
MMObjectBuilderhashCode in class MMObjectBuilderMMBase 1.9-SNAPSHOT - ${javadoctimestamp}