-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EWPP-4886: Automatic corporate role mappings.
- Loading branch information
Showing
24 changed files
with
1,547 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...tion_corporate_roles/config/install/field.field.user.user.oe_corporate_roles_mappings.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- field.storage.user.oe_corporate_roles_mappings | ||
module: | ||
- user | ||
id: user.user.oe_corporate_roles_mappings | ||
field_name: oe_corporate_roles_mappings | ||
entity_type: user | ||
bundle: user | ||
label: 'Corporate roles mappings' | ||
description: '' | ||
required: false | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: | ||
handler: 'default:corporate_roles_mapping' | ||
handler_settings: | ||
target_bundles: null | ||
auto_create: false | ||
field_type: entity_reference |
19 changes: 19 additions & 0 deletions
19
...ication_corporate_roles/config/install/field.storage.user.oe_corporate_roles_mappings.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- oe_authentication_corporate_roles | ||
- user | ||
id: user.oe_corporate_roles_mappings | ||
field_name: oe_corporate_roles_mappings | ||
entity_type: user | ||
type: entity_reference | ||
settings: | ||
target_type: corporate_roles_mapping | ||
module: core | ||
locked: false | ||
cardinality: -1 | ||
translatable: true | ||
indexes: { } | ||
persist_with_no_fields: false | ||
custom_storage: false |
20 changes: 20 additions & 0 deletions
20
...authentication_corporate_roles/config/schema/oe_authentication_corporate_roles.schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
oe_authentication_corporate_roles.corporate_roles_mapping.*: | ||
type: config_entity | ||
label: Corporate roles mapping | ||
mapping: | ||
id: | ||
type: string | ||
label: ID | ||
label: | ||
type: label | ||
label: Label | ||
uuid: | ||
type: string | ||
matching_value_type: | ||
type: string | ||
value: | ||
type: string | ||
roles: | ||
type: sequence | ||
sequence: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
modules/oe_authentication_corporate_roles/oe_authentication_corporate_roles.links.action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
entity.corporate_roles_mapping.add_form: | ||
route_name: 'entity.corporate_roles_mapping.add_form' | ||
title: 'Add corporate roles mapping' | ||
appears_on: | ||
- entity.corporate_roles_mapping.collection |
5 changes: 5 additions & 0 deletions
5
modules/oe_authentication_corporate_roles/oe_authentication_corporate_roles.links.menu.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
entity.corporate_roles_mapping.overview: | ||
title: Corporate role mappings | ||
parent: user.admin_index | ||
description: 'List of corporate roles mappings.' | ||
route_name: entity.corporate_roles_mapping.collection |
5 changes: 5 additions & 0 deletions
5
modules/oe_authentication_corporate_roles/oe_authentication_corporate_roles.links.task.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
entity.corporate_roles_mapping.collection: | ||
title: 'Corporate roles mappings' | ||
route_name: entity.corporate_roles_mapping.collection | ||
base_route: entity.user.collection | ||
weight: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
modules/oe_authentication_corporate_roles/oe_authentication_corporate_roles.permissions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
manage corporate roles: | ||
title: 'Administer corporate roles mapping' |
31 changes: 31 additions & 0 deletions
31
modules/oe_authentication_corporate_roles/oe_authentication_corporate_roles.routing.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
entity.corporate_roles_mapping.collection: | ||
path: '/admin/people/corporate-roles-mapping' | ||
defaults: | ||
_entity_list: 'corporate_roles_mapping' | ||
_title: 'Corporate roles mapping configuration' | ||
requirements: | ||
_permission: 'manage corporate roles' | ||
|
||
entity.corporate_roles_mapping.add_form: | ||
path: '/admin/people/corporate_roles_mapping/add' | ||
defaults: | ||
_entity_form: 'corporate_roles_mapping.add' | ||
_title: 'Add a corporate roles mapping' | ||
requirements: | ||
_permission: 'manage corporate roles' | ||
|
||
entity.corporate_roles_mapping.edit_form: | ||
path: '/admin/people/corporate-roles-mapping/{corporate_roles_mapping}' | ||
defaults: | ||
_entity_form: 'corporate_roles_mapping.edit' | ||
_title: 'Edit a corporate roles mapping' | ||
requirements: | ||
_permission: 'manage corporate roles' | ||
|
||
entity.corporate_roles_mapping.delete_form: | ||
path: '/admin/people/corporate-roles-mapping/{corporate_roles_mapping}/delete' | ||
defaults: | ||
_entity_form: 'corporate_roles_mapping.delete' | ||
_title: 'Delete a corporate roles mapping' | ||
requirements: | ||
_permission: 'manage corporate roles' |
9 changes: 9 additions & 0 deletions
9
modules/oe_authentication_corporate_roles/oe_authentication_corporate_roles.services.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
oe_authentication_corporate_roles.mapping_lookup: | ||
class: Drupal\oe_authentication_corporate_roles\CorporateRolesMappingLookup | ||
arguments: ['@entity_type.manager'] | ||
oe_authentication_corporate_roles.event_subscriber: | ||
class: Drupal\oe_authentication_corporate_roles\EventSubscriber\EuLoginSubscriber | ||
arguments: ['@oe_authentication_corporate_roles.mapping_lookup'] | ||
tags: | ||
- { name: event_subscriber } |
14 changes: 14 additions & 0 deletions
14
modules/oe_authentication_corporate_roles/src/CorporateRolesMappingInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Drupal\oe_authentication_corporate_roles; | ||
|
||
use Drupal\Core\Config\Entity\ConfigEntityInterface; | ||
|
||
/** | ||
* Provides an interface defining a corporate roles mapping entity type. | ||
*/ | ||
interface CorporateRolesMappingInterface extends ConfigEntityInterface { | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
modules/oe_authentication_corporate_roles/src/CorporateRolesMappingListBuilder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Drupal\oe_authentication_corporate_roles; | ||
|
||
use Drupal\Core\Config\Entity\ConfigEntityListBuilder; | ||
use Drupal\Core\Entity\EntityInterface; | ||
|
||
/** | ||
* Provides a listing of corporate roles mappings. | ||
*/ | ||
final class CorporateRolesMappingListBuilder extends ConfigEntityListBuilder { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function buildHeader(): array { | ||
$header['label'] = $this->t('Label'); | ||
$header['id'] = $this->t('Machine name'); | ||
$header['matching_value_type'] = $this->t('Matching type'); | ||
$header['value'] = $this->t('Value'); | ||
return $header + parent::buildHeader(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function buildRow(EntityInterface $entity): array { | ||
/** @var \Drupal\oe_authentication_corporate_roles\CorporateRolesMappingInterface $entity */ | ||
$row['label'] = $entity->label(); | ||
$row['id'] = $entity->id(); | ||
$row['matching_value_type'] = $entity->get('matching_value_type'); | ||
$row['value'] = $entity->get('value'); | ||
return $row + parent::buildRow($entity); | ||
} | ||
|
||
} |
Oops, something went wrong.