6 require_once(BASE.
"wcmf/lib/security/class.Role.php");
20 parent::Role($oid,
'RoleRDB');
22 parent::Role($oid, $type);
45 if ($name ==
'name') $displayName =
Message::get(
"name");
68 function getId($unconverted=
false)
127 if ($type ==
'UserRDB')
131 $children = parent::getChildrenEx(null,
'NMUserRole', array(
'fk_role_id' => $this->
getDBID()), null);
133 $grandChildren = array();
134 for($i=0; $i<
sizeof($children); $i++)
138 $grandChild = &$persistenceFacade->load($children[$i]->getUserRDBOID(),
BUILDDEPTH_SINGLE);
139 if ($grandChild != null)
142 $grandChild->addChild($children[$i]);
151 parent::loadChildren($type, $buildDepth, $forceUpdate);
163 $children = parent::getChildrenEx(null,
'NMUserRole', array(
'fk_role_id' => $this->
getDBID()), null);
164 $grandChildren = array();
166 for($i=0; $i<
sizeof($children); $i++)
169 $grandChildrenParents = array();
170 foreach ($children[$i]->
getProperty(
'parentoids') as $parentoid)
174 $tmpParents = $children[$i]->getParentsEx($parentoid, null, null, null);
175 if (
sizeof($tmpParents) > 0)
176 $curChildParent = &$tmpParents[0];
179 if ($curChildParent != null)
180 $grandChildrenParents[
sizeof($grandChildrenParents)] = &$curChildParent;
183 for($j=0; $j<
sizeof($grandChildrenParents); $j++)
184 $grandChildren[
sizeof($grandChildren)] = &$grandChildrenParents[$j];
186 return Node::filter($grandChildren, $oid, $type, $values, $properties);
189 return parent::getChildrenEx($oid, $type, $values, $properties);
197 if ($child != null && $child->getType() ==
'UserRDB')
202 $relOID = $persistenceFacade->getFirstOID(
'NMUserRole', array(
'fk_role_id' => $this->
getDBID(),
'fk_user_id' => $child->getDBID()));
206 $associationNode = &$persistenceFacade->create(
'NMUserRole', BUILDTYPE_SINGLE);
207 $associationNode->setRoleRDB($this);
208 $associationNode->setUserRDB($child);
209 $child->addChild($associationNode);
212 $associationNode = &$persistenceFacade->load($relOID, BUILDTYPE_SINGLE);
214 $child = &$associationNode;
217 parent::addChild($child, $addtype);
230 array_unshift($ids, $this->
getDBID());
234 parent::deleteChild($childOID, $reallyDelete);
getValueDisplayName($name, $type=null)
loadChildren($type, $buildDepth=BUILDDEPTH_SINGLE, $forceUpdate=false)
get($message, $parameters=null, $domain='', $lang='')
warn($message, $category)
deleteChild($childOID, $reallyDelete=false)
Abstract base class for role classes that represent a user role.
getValueDescription($name, $type=null)
getValue($name, $type=null)
filter(&$nodeList, $oid, $type, $values, $properties, $useRegExp=true)
getOIDParameter($oid, $param, $validate=true)
getChildrenEx($oid, $type, $values, $properties)
addChild(&$child, $addtype=ADDCHILD_BACK)
setValue($name, $value, $type=null, $forceSet=false)
getName($unconverted=false)
RoleRDBBase($oid=null, $type=null)
getId($unconverted=false)
getUnconvertedValue($name, $type=null)