isAdmin()) { $result = array('type'=>'error', 'msg'=>getMLText("access_denied")); echo json_encode($result); exit; } if (isset($_GET["action"])) $action=$_GET["action"]; else $action=NULL; if (isset($_GET["aroid"])) { if(!($aro = SeedDMS_Aro::getInstance((int) $_GET["aroid"], $dms))) { $result = array('type'=>'error', 'msg'=>'1'.getMLText("access_denied")); echo json_encode($result); exit; } } else { $result = array('type'=>'error', 'msg'=>'2'.getMLText("access_denied")); echo json_encode($result); exit; } if (isset($_GET["acoid"])) { if(!($aco = SeedDMS_Aco::getInstance((int) $_GET["acoid"], $dms))) { $result = array('type'=>'error', 'msg'=>'3'.getMLText("access_denied")); echo json_encode($result); exit; } } else { $result = array('type'=>'error', 'msg'=>'4'.getMLText("access_denied")); echo json_encode($result); exit; } switch($action) { case "toggle_permission": $acl = new SeedDMS_Acl($dms); if($acl->toggle($aro, $aco)) $result = array('type'=>'success', 'msg'=>'lasjfl'); else $result = array('type'=>'error', 'msg'=>'lasjfl'); header('Content-Type: application/json'); echo json_encode($result); break; case "add_permission": $acl = new SeedDMS_Acl($dms); if($acl->add($aro, $aco)) $result = array('type'=>'success', 'msg'=>'lasjfl'); else $result = array('type'=>'error', 'msg'=>'lasjfl'); header('Content-Type: application/json'); $result = array('type'=>'success', 'msg'=>'lasjfl'); echo json_encode($result); break; case "remove_permission": $acl = new SeedDMS_Acl($dms); if($acl->remove($aro, $aco)) $result = array('type'=>'success', 'msg'=>'lasjfl'); else $result = array('type'=>'error', 'msg'=>'lasjfl'); header('Content-Type: application/json'); $result = array('type'=>'success', 'msg'=>'lasjfl'); echo json_encode($result); break; }