Commit 141eacf0162c80ba1c7f7708b18bbb4723bb10a0

Authored by Alex Savenko
1 parent 5df28bdb

project entity

app/library/App/Model/Project.php
... ... @@ -29,11 +29,11 @@ class Project extends \App\Mvc\DateTrackingModel {
29 29 ];
30 30 }
31 31  
32   - public function initialize() {
33   -
34   - $this->belongsTo('user_id', User::class, 'id', [
35   - 'alias' => 'User',
36   - ]);
37   - }
  32 +// public function initialize() {
  33 +//
  34 +// $this->belongsTo('user_id', User::class, 'id', [
  35 +// 'alias' => 'User',
  36 +// ]);
  37 +// }
38 38  
39 39 }
40 40 \ No newline at end of file
... ...
app/library/App/Resources/ProjectResource.php
... ... @@ -26,9 +26,11 @@ class ProjectResource extends ApiResource {
26 26 ->expectsJsonData()
27 27 ->transformer(ProjectTransformer::class)
28 28 ->handler(CrudResourceController::class)
29   - ->itemKey('project')
  29 + ->singleKey('project')
  30 + ->multipleKey('projects')
  31 + //->itemKey('project')
30 32 ->collectionKey('projects')
31   - ->deny(AclRoles::UNAUTHORIZED)
  33 + ->alow(AclRoles::USER)
32 34  
33 35 ->endpoint(ApiEndpoint::all())
34 36 ->endpoint(ApiEndpoint::create())
... ...