Permalink
Browse files

Remove DBA layer for privileges (since it's almost a contradiction in…

… terms to have it), and disable metadata, refs #98
  • Loading branch information...
flack committed Oct 6, 2017
1 parent 3f4996a commit ad0b9169e28b93997de3da7eb4439337d0e4b050
@@ -113,7 +113,6 @@ public function initialize()
// Start-up some of the services
$this->dbclassloader->load_classes('midcom', 'legacy_classes.inc');
$this->dbclassloader->load_classes('midcom', 'core_classes.inc');
$this->componentloader->load_all_manifests();
@@ -780,7 +780,7 @@ private static function _delete_privileges(midcom_core_dbaobject $object)
$result = $qb->execute();
foreach ($result as $dbpriv) {
if (!$dbpriv->delete()) {
if (!$dbpriv->purge()) {
return false;
}
}

This file was deleted.

Oops, something went wrong.
@@ -85,7 +85,7 @@ public function delete()
$qb->add_constraint('assignee', '=', $user->id);
foreach ($qb->execute() as $entry) {
debug_add("Deleting privilege {$entry->privilegename} ID {$entry->id} on {$entry->objectguid}");
$entry->delete();
$entry->purge();
}
return true;
@@ -465,7 +465,7 @@ public static function get_privilege($object, $name, $assignee, $classname = '')
midcom::get()->auth->request_sudo('midcom.core');
while (count($result) > 1) {
$privilege = array_pop($result);
$privilege->delete();
$privilege->purge();
}
midcom::get()->auth->drop_sudo();
}

This file was deleted.

Oops, something went wrong.
@@ -464,13 +464,13 @@ public function copy_attachments(&$source, &$target)
*/
public function copy_privileges($source, $target)
{
$qb = midcom_db_privilege::new_query_builder();
$qb = midcom_core_privilege_db::new_query_builder();
$qb->add_constraint('objectguid', '=', $source->guid);
$results = $qb->execute();
foreach ($results as $privilege) {
$new = new midcom_db_privilege();
$new = new midcom_core_privilege_db();
$new->objectguid = $target->guid;
$new->classname = $privilege->classname;
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Schema xmlns="http://www.midgard-project.org/repligard/1.4">
<type name="midcom_core_privilege_db" table="midcom_core_privilege">
<type name="midcom_core_privilege_db" table="midcom_core_privilege" metadata="false">
<property name="id" type="unsigned integer" primaryfield="id">
<description>Local non-replication-safe database identifier</description>
</property>

0 comments on commit ad0b916

Please sign in to comment.