Skip to content

Commit f0ef468

Browse files
committed
v1.1.3 - fix locked roles
When a user edited the roles through the Customizations UI, it was setting all Teams roles to is_editable:0, making them all locked. This was because the plugin wasn't overriding the roles in the filter to get roles. Removed the checks to see if the roles already exist so that they get overridden with the expected value (undefined) for is_editable. Customized permissions still get set in a lower priority filter.
1 parent 163d798 commit f0ef468

3 files changed

Lines changed: 40 additions & 48 deletions

File tree

disciple-tools-team-module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: The Team Module adds a way to access and share contacts and groups in a collaborative team setting.
66
* Text Domain: disciple-tools-team-module
77
* Domain Path: /languages
8-
* Version: 1.1.2
8+
* Version: 1.1.3
99
* Author URI: https://github.com/cairocoder01
1010
* GitHub Plugin URI: https://github.com/cairocoder01/disciple-tools-team-module
1111
* Requires at least: 4.7.0

post-type/module-base.php

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -106,51 +106,43 @@ public function dt_set_roles_and_permissions( $expected_roles ){
106106
'update_any_trainings' => true,
107107
), $base_team_member_permissions );
108108

109-
if ( !isset( $expected_roles['team_member'] ) ){
110-
$expected_roles['team_member'] = array(
111-
'label' => __( 'Team Member', 'disciple-tools-team-module' ),
112-
'description' => 'Interacts with Contacts, Groups, etc., for a given team',
113-
'permissions' => $base_team_member_permissions,
114-
);
115-
}
116-
117-
if ( !isset( $expected_roles['team_collaborator'] ) ){
118-
$expected_roles['team_collaborator'] = array(
119-
'label' => __( 'Team Collaborator', 'disciple-tools-team-module' ),
120-
'description' => 'Access to all Contacts, Groups, etc. for all teams',
121-
'permissions' => wp_parse_args( array(), $general_all_teams_permissions ),
122-
'order' => 20,
123-
);
124-
}
125-
126-
if ( !isset( $expected_roles['team_leader'] ) ){
127-
$expected_roles['team_leader'] = array(
128-
'label' => __( 'Team Leader', 'disciple-tools-team-module' ),
129-
'description' => 'Access to all Contacts, Groups, etc. for all teams and access to update their team',
130-
'permissions' => wp_parse_args( array(
131-
'access_teams' => true,
132-
'view_any_teams' => true,
133-
'update_my_teams' => true,
134-
), $general_all_teams_permissions ),
135-
'order' => 20,
136-
);
137-
}
138-
139-
if ( !isset( $expected_roles['teams_admin'] ) ) {
140-
$expected_roles['teams_admin'] = array(
141-
'label' => __( 'Teams Admin', 'disciple-tools-team-module' ),
142-
'description' => 'Admin access to all teams',
143-
'permissions' => wp_parse_args( array(
144-
'view_project_metrics' => true,
145-
146-
'access_teams' => true,
147-
'create_teams' => true,
148-
'view_any_teams' => true,
149-
'update_any_teams' => true,
150-
), $general_all_teams_permissions ),
151-
'order' => 20,
152-
);
153-
}
109+
$expected_roles['team_member'] = array(
110+
'label' => __( 'Team Member', 'disciple-tools-team-module' ),
111+
'description' => 'Interacts with Contacts, Groups, etc., for a given team',
112+
'permissions' => $base_team_member_permissions,
113+
);
114+
115+
$expected_roles['team_collaborator'] = array(
116+
'label' => __( 'Team Collaborator', 'disciple-tools-team-module' ),
117+
'description' => 'Access to all Contacts, Groups, etc. for all teams',
118+
'permissions' => wp_parse_args( array(), $general_all_teams_permissions ),
119+
'order' => 20,
120+
);
121+
122+
$expected_roles['team_leader'] = array(
123+
'label' => __( 'Team Leader', 'disciple-tools-team-module' ),
124+
'description' => 'Access to all Contacts, Groups, etc. for all teams and access to update their team',
125+
'permissions' => wp_parse_args( array(
126+
'access_teams' => true,
127+
'view_any_teams' => true,
128+
'update_my_teams' => true,
129+
), $general_all_teams_permissions ),
130+
'order' => 20,
131+
);
132+
133+
$expected_roles['teams_admin'] = array(
134+
'label' => __( 'Teams Admin', 'disciple-tools-team-module' ),
135+
'description' => 'Admin access to all teams',
136+
'permissions' => wp_parse_args( array(
137+
'view_project_metrics' => true,
138+
139+
'access_teams' => true,
140+
'create_teams' => true,
141+
'view_any_teams' => true,
142+
'update_any_teams' => true,
143+
), $general_all_teams_permissions ),
144+
'order' => 20,
145+
);
154146

155147

156148
// Only admins can view/update the teams post type

version-control.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Disciple.Tools - Team Module",
3-
"version": "1.1.2",
4-
"last_updated": "2025-07-30",
3+
"version": "1.1.3",
4+
"last_updated": "2025-08-14",
55
"author": "cairocoder01",
66
"author_homepage": "https://github.com/cairocoder01",
77
"git_owner": "cairocoder01",

0 commit comments

Comments
 (0)