I made a web form and I was able to check if the user has permission for the doctype on which web form is based on
frappe.ready(function() {
// // bind events here
frappe.has_permission("doctype_name", "", "create")
.then((res)=>{
console.log("has_perm: ",res.message.has_permission)
if(res.message.has_permission != true){
frappe.throw("You can't Access this Form");
return false;
}
})
})
now if res.message.has_permission != true then user should be
unable to open the web form or simply they should be unable to access the web form or when saved then it should say unable to access the web form and should not be saved
so i tried using “return false;” but no use how can I do it