Add additional_acl column to edit_access table

To be able to have special ACL (json) for edit edit access table too
This commit is contained in:
Clemens Schwaighofer
2019-09-03 09:39:12 +09:00
parent 9ec19f5940
commit 605ea06bf0
5 changed files with 14 additions and 4 deletions

View File

@@ -14,5 +14,6 @@ CREATE TABLE edit_access (
uid VARCHAR,
enabled SMALLINT NOT NULL DEFAULT 0,
protected INT,
deleted SMALLINT DEFAULT 0
deleted SMALLINT DEFAULT 0,
additional_acl JSONB
) INHERITS (edit_generic) WITHOUT OIDS;

View File

@@ -13,7 +13,7 @@ CREATE TABLE edit_group (
deleted SMALLINT DEFAULT 0,
edit_scheme_id INT,
edit_access_right_id INT NOT NULL,
alternative_acl JSONB,
additional_acl JSONB,
FOREIGN KEY (edit_scheme_id) REFERENCES edit_scheme (edit_scheme_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (edit_access_right_id) REFERENCES edit_access_right (edit_access_right_id) MATCH FULL ON DELETE CASCADE ON UPDATE CASCADE
) INHERITS (edit_generic) WITHOUT OIDS;

View File

@@ -411,6 +411,7 @@ if ($form->my_page_name == 'edit_order') {
$elements[] = $form->formCreateElement("description");
// add name/value list here
$elements[] = $form->formCreateElementListTable("edit_access_data");
$elements[] = $form->formCreateElement("additional_acl");
break;
default:
print "[No valid page definition given]";

View File

@@ -49,7 +49,15 @@ $edit_access = array (
"1" => "Yes",
"0" => "No"
)
)
),
"additional_acl" => array (
"value" => $GLOBALS["additional_acl"],
"output_name" => "Additional ACL (as JSON)",
"type" => "textarea",
"error_check" => "json",
"rows" => 10,
"cols" => 60
),
),
"table_name" => "edit_access",
"load_query" => "SELECT edit_access_id, name FROM edit_access ORDER BY name",

View File

@@ -442,7 +442,7 @@ class Basic
// on second call it sends the end time and then also prints the running time
public function runningTime($simple = false)
{
list($micro, $timestamp) = explode(" ", microtime());
list($micro, $timestamp) = explode(' ', microtime());
$string = '';
$running_time = '';
if (!$this->starttime) {