diff --git a/tide_site.install b/tide_site.install index 8334805..8d6b78c 100644 --- a/tide_site.install +++ b/tide_site.install @@ -5,6 +5,8 @@ * Install file for tide_site. */ +use Drupal\user\Entity\Role; + /** * Implements hook_install(). */ @@ -17,3 +19,20 @@ function tide_site_install() { } } } + +/** + * Approver should have permission to create/edit terms in sites. + */ +function tide_site_update_10000() { + $approver = Role::load('approver'); + $permissions = [ + 'create terms in sites', + 'edit terms in sites', + ]; + if ($approver) { + foreach ($permissions as $permission) { + $approver->grantPermission($permission); + } + $approver->save(); + } +}