Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CiviCRM Permissions Sync
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
plugins
CiviCRM Permissions Sync
Commits
a8a4636e
Commit
a8a4636e
authored
Apr 10, 2019
by
Christian Wach
⚽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sanity check role before adding caps
parent
5d797086
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
reset-wp-civicrm-roles-caps.php
reset-wp-civicrm-roles-caps.php
+5
-0
No files found.
reset-wp-civicrm-roles-caps.php
View file @
a8a4636e
...
@@ -257,6 +257,11 @@ class CiviCRM_Permissions_Sync {
...
@@ -257,6 +257,11 @@ class CiviCRM_Permissions_Sync {
// Get the role to apply all CiviCRM permissions to.
// Get the role to apply all CiviCRM permissions to.
$custom_role
=
$this
->
role_get
();
$custom_role
=
$this
->
role_get
();
// Bail if something went wrong.
if
(
empty
(
$custom_role
)
)
{
return
;
}
// Add the capabilities if not already added.
// Add the capabilities if not already added.
foreach
(
$capabilities
as
$capability
)
{
foreach
(
$capabilities
as
$capability
)
{
if
(
!
$custom_role
->
has_cap
(
$capability
)
)
{
if
(
!
$custom_role
->
has_cap
(
$capability
)
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment