Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM: Ensure segments can be deleted #34690

Merged
merged 5 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Segments: Fixing a bug to ensure segments can be deleted with Advanced Segments active
6 changes: 5 additions & 1 deletion projects/plugins/crm/includes/ZeroBSCRM.AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -3741,7 +3741,11 @@ function zeroBSCRM_AJAX_enactListViewBulkAction() {
// Check perms for given object
$has_perms = zeroBSCRM_permsObjType( $zbs->DAL->objTypeID( $objtype ) ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
if ( ! $has_perms ) {
jpcrm_api_forbidden_request();
$reply = array(
'status' => __( 'Forbidden', 'zero-bs-crm' ),
'message' => __( 'You do not have permission to access this resource.', 'zero-bs-crm' ),
);
wp_send_json_error( $reply, 403 );
}

// ret
Expand Down
3 changes: 2 additions & 1 deletion projects/plugins/crm/includes/ZeroBSCRM.Permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ function zeroBSCRM_permsObjType( $obj_type_id = -1 ) { // phpcs:ignore WordPress
switch ( $obj_type_id ) {
case ZBS_TYPE_CONTACT:
case ZBS_TYPE_COMPANY:
case ZBS_TYPE_SEGMENT:
return zeroBSCRM_permsCustomers();

case ZBS_TYPE_QUOTE:
Expand All @@ -577,6 +578,7 @@ function zeroBSCRM_permsObjType( $obj_type_id = -1 ) { // phpcs:ignore WordPress

case ZBS_TYPE_TASK:
return zeroBSCRM_perms_tasks();

}

return false;
Expand Down Expand Up @@ -716,7 +718,6 @@ function zeroBSCRM_permsExport(){
return false;
}


// LOGS


Expand Down