68 $roles = explode(
",", $item->$field);
71 if(!preg_match(
"/$del_role/",
$role))
75 if(count($newRoles) > 0)
76 $newRole = implode(
",", $newRoles);
80 $item->$field = $newRole;
81 $item->filter =
new InclusionFilter(
$field);
95 if (count(
$items) == 0)
return;
98 if (!
$items instanceof DataItem)
return;
104 if (!$item->hasField(
$field))
continue;
120 $oldFilter = $item->filter;
121 $item->filter =
new InclusionFilter(
$field);
124 $item->filter = $oldFilter;
138 if (count(
$items) == 0)
return;
141 if (!
$items instanceof DataItem)
return;
147 if (!$item->hasField(
$field))
continue;
166 $oldFilter = $item->filter;
167 $item->filter =
new InclusionFilter(
$field);
168 $item->set(
$field, implode(
",", $newRoles));
170 $item->filter = $oldFilter;
183 $mgr->upgrade($version);
static using()
Import the datamodels, views and manifest for the specified component(s).
static deleteRoleFromString(&$items, $del_role, $field="")
static upgradeComponent($version)
static addRoleToAccessList($items, $role, $field="role")
Adds the specified role to the access list field in each of the supplied DataItems.
static registerSerializationHandler()
static removeRoleFromAccessList($items, $role, $field="role")
Removes the specified role from the access list field in each of the supplied DataItems.
registerHandler($component, $title, $handler)
Registers a serialization handler for a component.
Provides a simple implementation of a SerializationHandler that can serialize a single DataItem class...