From f1823095442a22a1afbaa39ab1764b887b8970ec Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Wed, 20 May 2015 13:46:06 -0400 Subject: [PATCH] Clearing and resetting administrator capabilities for plugin --- activate.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/activate.php b/activate.php index 9b3d6798..59a9270a 100644 --- a/activate.php +++ b/activate.php @@ -100,6 +100,7 @@ class glmMembersPluginActivate extends glmPluginSupport // Add user capabilties $this->addRoleCapability('glm_members_edit', array( + 'administrator' => true, 'author' => false, 'contributor' => false, 'editor' => true, @@ -108,6 +109,7 @@ class glmMembersPluginActivate extends glmPluginSupport ); $this->addRoleCapability('glm_members_configure', array( + 'administrator' => true, 'author' => false, 'contributor' => false, 'editor' => false, @@ -116,6 +118,7 @@ class glmMembersPluginActivate extends glmPluginSupport ); $this->addRoleCapability('glm_members_info', array( + 'administrator' => true, 'author' => false, 'contributor' => false, 'editor' => true, @@ -334,6 +337,11 @@ class glmMembersPluginActivate extends glmPluginSupport // For each role object foreach ($roleObjects as $key => $role) { + // Uncomment to reset capabilities + if ( isset($role->capabilities[$capability])) { + $role->remove_cap($capability); + } + // Check if the role exists in list of editable roles and // the capability does not exist if (isset($roles[$key]) && ! isset($role->capabilities[$capability])) { -- 2.17.1