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