25 include_once (
'Class.ObjectPermission.php');
26 include_once (
'Class.Application.php');
40 $cid = $this->classid;
41 $this->userid = $action->parent->user->id;
67 if ($this->IsAffected())
if ($this->
IsControlled())
return $this->operm->Control($this, $aclname);
70 return "object not initialized : $aclname";
78 if (!isset($this->
id))
return "";
95 if (!isset($this->
id))
return "";
99 $cobj->id_class = $this->classid;
109 $this->operm->Delete();
112 $acl->Set(
"modifyacl", $this->classid);
113 $this->operm->AddAcl($acl->id);
115 $acl->Set(
"viewacl", $this->classid);
116 $this->operm->AddAcl($acl->id);
118 while (list($k, $v) = each($this->obj_acl)) {
119 $acl->Set($v[
"name"], $this->classid);
120 $this->operm->AddAcl($acl->id);
131 if (!isset($this->
id))
return "";
133 $this->operm->delete();
149 return $cobj->IsAffected();
180 "name" =>
"modifyacl",
181 "description" =>
N_(
"modify object acl")
185 "description" =>
N_(
"view object acl")
189 if (!((isset($obj->obj_acl)) && (is_array($obj->obj_acl)))) {
190 $this->log->warning(
"InitObjectAcl no Acl for object class " . get_class($this));
193 $this->obj_acl = array_merge($this->obj_acl, $defacl);
197 if (($id_app =
$app->GetIdFromName(get_class($this))) == 0) {
199 $app->name = get_class($this);
200 $app->short_name = get_class($this) .
" Class";
201 $app->description = get_class($this) .
" Class";
202 $app->access_free =
"N";
203 $app->available =
"N";
205 $app->displayable =
"N";
206 $app->objectclass =
"Y";
210 $app->Select($id_app);
215 $acl->Init(
$app, $this->obj_acl,
true);