|
@@ 427-442 (lines=16) @@
|
| 424 |
|
return $this->createMessage($data); |
| 425 |
|
} |
| 426 |
|
|
| 427 |
|
public function createPrivileges(array $data) |
| 428 |
|
{ |
| 429 |
|
$connection = $this->container->get('connection'); |
| 430 |
|
$acl = $this->container->get('acl'); |
| 431 |
|
$privileges = new DirectusPrivilegesTableGateway($connection, $acl); |
| 432 |
|
|
| 433 |
|
$response = [ |
| 434 |
|
'meta' => [ |
| 435 |
|
'type' => 'entry', |
| 436 |
|
'table' => 'directus_privileges' |
| 437 |
|
], |
| 438 |
|
'data' => $privileges->insertPrivilege($data) |
| 439 |
|
]; |
| 440 |
|
|
| 441 |
|
return $this->createResponseFromData($response); |
| 442 |
|
} |
| 443 |
|
|
| 444 |
|
public function createTable($name, array $data = []) |
| 445 |
|
{ |
|
@@ 527-542 (lines=16) @@
|
| 524 |
|
return $this->createResponseFromData($response); |
| 525 |
|
} |
| 526 |
|
|
| 527 |
|
public function getPreferences($table, $user) |
| 528 |
|
{ |
| 529 |
|
$acl = $this->container->get('acl'); |
| 530 |
|
$connection = $this->container->get('connection'); |
| 531 |
|
$preferencesTableGateway = new DirectusPreferencesTableGateway($connection, $acl); |
| 532 |
|
|
| 533 |
|
$response = [ |
| 534 |
|
'meta' => [ |
| 535 |
|
'type' => 'entry', |
| 536 |
|
'table' => 'directus_preferences' |
| 537 |
|
], |
| 538 |
|
'data' => $preferencesTableGateway->fetchByUserAndTableAndTitle($user, $table) |
| 539 |
|
]; |
| 540 |
|
|
| 541 |
|
return $this->createResponseFromData($response); |
| 542 |
|
} |
| 543 |
|
|
| 544 |
|
/** |
| 545 |
|
* Get a table gateway for the given table name |