<?php 	

require_once '../../Server/connection.php';


$valid['success'] = array('success' => false, 'messages' => array());

$productId = $_POST['productId'];

if($productId) { 


 $sql = "DELETE FROM assigned_permissions WHERE assign_id = {$productId}";
 
 
 

 if($conn->query($sql) === TRUE){
 	$valid['success'] = true;
	$valid['messages'] = "Permission is successfully Deleted";		
 } else {
 	$valid['success'] = false;
 	$valid['messages'] = "Error while Deleting Permission";
 }
			
			
		   


 $conn->close();

 echo json_encode($valid);
 
} // /if $_POST