| @@ 456-471 (lines=16) @@ | ||
| 453 | return $this->createMessage($data); |
|
| 454 | } |
|
| 455 | ||
| 456 | public function createPrivileges(array $data) |
|
| 457 | { |
|
| 458 | $connection = $this->container->get('connection'); |
|
| 459 | $acl = $this->container->get('acl'); |
|
| 460 | $privileges = new DirectusPrivilegesTableGateway($connection, $acl); |
|
| 461 | ||
| 462 | $response = [ |
|
| 463 | 'meta' => [ |
|
| 464 | 'type' => 'item', |
|
| 465 | 'table' => 'directus_privileges' |
|
| 466 | ], |
|
| 467 | 'data' => $privileges->insertPrivilege($data) |
|
| 468 | ]; |
|
| 469 | ||
| 470 | return $this->createResponseFromData($response); |
|
| 471 | } |
|
| 472 | ||
| 473 | public function createTable($name, array $data = []) |
|
| 474 | { |
|
| @@ 556-571 (lines=16) @@ | ||
| 553 | return $this->createResponseFromData($response); |
|
| 554 | } |
|
| 555 | ||
| 556 | public function getPreferences($table, $user) |
|
| 557 | { |
|
| 558 | $acl = $this->container->get('acl'); |
|
| 559 | $connection = $this->container->get('connection'); |
|
| 560 | $preferencesTableGateway = new DirectusPreferencesTableGateway($connection, $acl); |
|
| 561 | ||
| 562 | $response = [ |
|
| 563 | 'meta' => [ |
|
| 564 | 'type' => 'item', |
|
| 565 | 'table' => 'directus_preferences' |
|
| 566 | ], |
|
| 567 | 'data' => $preferencesTableGateway->fetchByUserAndTableAndTitle($user, $table) |
|
| 568 | ]; |
|
| 569 | ||
| 570 | return $this->createResponseFromData($response); |
|
| 571 | } |
|
| 572 | ||
| 573 | /** |
|
| 574 | * @inheritdoc |
|