diff --git a/README.md b/README.md index 36b660d..fc6d85e 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ Nato vzpostavimo / poženemo zabojnike z ukazom `ddev start`. Namestimo odvisne PHP pakete z ukazom `ddev composer install`. -@TODO uvoz baze - Osnovne podatke pa vnesemo z ukazuma: `ddev drush site:install --account-name=root --account-pass=toor --existing-config minimal` diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index e4565d8..fae8ba6 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -47,6 +47,7 @@ module: update: 0 user: 0 views_ui: 0 + yufu_admin: 0 content_translation: 10 views: 10 minimal: 1000 diff --git a/config/sync/user.role.authenticated.yml b/config/sync/user.role.authenticated.yml index 92f67d6..30caa03 100644 --- a/config/sync/user.role.authenticated.yml +++ b/config/sync/user.role.authenticated.yml @@ -4,6 +4,7 @@ status: true dependencies: module: - system + - yufu_admin _core: default_config_hash: dJ0L2DNSj5q6XVZAGsuVDpJTh5UeYkIPwKrUOOpr8YI id: authenticated @@ -12,3 +13,4 @@ weight: 1 is_admin: false permissions: - 'access content' + - 'use jsonapi operation link' diff --git a/web/modules/custom/yufu_admin/yufu_admin.info.yml b/web/modules/custom/yufu_admin/yufu_admin.info.yml new file mode 100644 index 0000000..7774559 --- /dev/null +++ b/web/modules/custom/yufu_admin/yufu_admin.info.yml @@ -0,0 +1,7 @@ +name: Yufu Admin +type: module +description: Provides admin functionality. +package: Yufu +core_version_requirement: ^9 || ^10 +dependencies: + - drupal:jsonapi diff --git a/web/modules/custom/yufu_admin/yufu_admin.module b/web/modules/custom/yufu_admin/yufu_admin.module new file mode 100644 index 0000000..7dd23f6 --- /dev/null +++ b/web/modules/custom/yufu_admin/yufu_admin.module @@ -0,0 +1,30 @@ +getEntityType(); + // @todo Only for entity node - should we add other entities as well? + if ($entityType->id() === 'node' && \Drupal::currentUser()->hasPermission('use jsonapi operation link')) { + // Build the url. + $url = Url::fromRoute(sprintf('jsonapi.%s--%s.individual', $entityType->id(), $entity->bundle()), + ['entity' => $entity->uuid()] + ); + $operations['view-jsonapi-output'] = [ + 'title' => t('jsonapi Output'), + 'weight' => 50, + 'url' => $url, + ]; + } + return $operations; +} diff --git a/web/modules/custom/yufu_admin/yufu_admin.permissions.yml b/web/modules/custom/yufu_admin/yufu_admin.permissions.yml new file mode 100644 index 0000000..4e97508 --- /dev/null +++ b/web/modules/custom/yufu_admin/yufu_admin.permissions.yml @@ -0,0 +1,3 @@ +'use jsonapi operation link': + title: 'Use jsonapi operation link' + description: 'Access jsonapi operation link.'