From 5c5b38e2bc288e7cc660a22fbd0b2d76a86749b8 Mon Sep 17 00:00:00 2001
From: Lily Yan <lily.yan@uwaterloo.ca>
Date: Mon, 8 Mar 2021 10:31:00 -0500
Subject: [PATCH] ISTWCMS-4682 Add profile permissions to the content access
 list

---
 src/UwPermissions/UwPermissions.php | 18 ++++++++++++++++++
 uw_cfg_common.install               | 15 +++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/src/UwPermissions/UwPermissions.php b/src/UwPermissions/UwPermissions.php
index 05b9e4c9..f12438a3 100644
--- a/src/UwPermissions/UwPermissions.php
+++ b/src/UwPermissions/UwPermissions.php
@@ -155,6 +155,24 @@ class UwPermissions {
         ),
       ],
 
+      // Profile permissions.
+      'Profile' => [
+        'Use content type' =>
+        UwPermissions::buildRolePermissionsListContentType(
+         'uw_ct_profile'
+        ),
+        'Create/edit type' =>
+        UwPermissions::buildRolePermissionsListTaxonomyTerm(
+         'uw_vocab_profile_type',
+          ['create', 'edit']
+        ),
+        'Delete type' =>
+        UwPermissions::buildRolePermissionsListTaxonomyTerm(
+         'uw_vocab_profile_type',
+          ['delete']
+        ),
+      ],
+
       // Sidebar permissions.
       'Sidebar' => [
         'Use content type' =>
diff --git a/uw_cfg_common.install b/uw_cfg_common.install
index 13801df0..a0628aaf 100644
--- a/uw_cfg_common.install
+++ b/uw_cfg_common.install
@@ -97,6 +97,21 @@ function uw_cfg_common_install() {
         'Site manager',
       ],
     ],
+    'Profile' => [
+      'Use content type' => [
+        'Site manager',
+        'Content author',
+        'Content editor',
+      ],
+      'Create/edit type' => [
+        'Site manager',
+        'Content author',
+        'Content editor',
+      ],
+      'Delete type' => [
+        'Site manager',
+      ],
+    ],
     'Sidebar' => [
       'Use content type' => [
         'Site manager',
-- 
GitLab