Skip to content
Snippets Groups Projects
Commit 021650df authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Sebastian Listl
Browse files

1070975 fix linked documents grant delete

parent 985bea50
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ var currentContext = ContextUtils.getCurrentContextId();
var canDelete = new HasLinkedObjectTester()
.andNoEntityRows("DistrictContact_entity", "DistrictContacts", {ObjectId_param : currentContext, RowId_param : rowId}) //District Contact
.andNoEntityRows("Document_entity", "Documents", {AssignmentTable_param : "DISTRICTRESPONSIBLE", AssignmentRowId_param : rowId}) //Documents
.validate();
result.string(canDelete);
\ No newline at end of file
......@@ -5,7 +5,7 @@
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/District_entity/documentation.adoc</documentation>
<icon>VAADIN:GLOBE</icon>
<grantDelete v="false" />
<grantDelete v="true" />
<grantDeleteProcess>%aditoprj%/entity/District_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/District_entity/contentTitleProcess.js</contentTitleProcess>
<iconIdProcess>%aditoprj%/entity/District_entity/iconIdProcess.js</iconIdProcess>
......
......@@ -6,7 +6,11 @@ import("system.vars");
var districtId = vars.get("$field.DISTRICTID");
var count = newSelect("COUNT(*)")
.from("DISTRICT")
.where("DISTRICT.PARENTDISTRICT_DISTRICTID", districtId)
.cell();
result.string(count == 0);
.where("DISTRICT.PARENTDISTRICT_DISTRICTID", districtId);
var canDelete = new HasLinkedObjectTester()
.andNoEntityRows("Document_entity", "Documents", {AssignmentTable_param : "DISTRICT", AssignmentRowId_param : districtId}) //Documents
.andSqlYieldsZero(count)
.validate();
result.string(canDelete);
......@@ -6,7 +6,8 @@
<documentation>%aditoprj%/entity/LeadLog_entity/documentation.adoc</documentation>
<grantCreate v="false" />
<grantUpdate v="false" />
<grantDelete v="false" />
<grantDelete v="true" />
<grantDeleteProcess>%aditoprj%/entity/LeadLog_entity/grantDeleteProcess.js</grantDeleteProcess>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
......
import("system.vars");
import("system.result");
var leadLogId = vars.get("$field.LEADLOGID");
var canDelete = new HasLinkedObjectTester()
.andNoEntityRows("Document_entity", "Documents", {AssignmentTable_param : "LEADLOG", AssignmentRowId_param : leadLogId}) //Documents
.validate();
result.string(canDelete);
\ No newline at end of file
......@@ -8,6 +8,7 @@ var currentContext = ContextUtils.getCurrentContextId();
var canDelete = new HasLinkedObjectTester()
.andNoEntityRows("Task_entity", "Tasks", {ObjectId_param : currentContext, RowId_param : rowId}) //Tasks
.andNoEntityRows("Document_entity", "Documents", {AssignmentTable_param : "LEADIMPORT", AssignmentRowId_param : rowId}) //Documents
.validate();
result.string(canDelete);
......@@ -4,6 +4,7 @@
<title>Support Ticket</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/SupportTicket_entity/documentation.adoc</documentation>
<grantDeleteProcess>%aditoprj%/entity/SupportTicket_entity/grantDeleteProcess.js</grantDeleteProcess>
<contentTitleProcess>%aditoprj%/entity/SupportTicket_entity/contentTitleProcess.js</contentTitleProcess>
<contentDescriptionProcess>%aditoprj%/entity/SupportTicket_entity/contentDescriptionProcess.js</contentDescriptionProcess>
<afterUiInit>%aditoprj%/entity/SupportTicket_entity/afterUiInit.js</afterUiInit>
......
import("system.vars");
import("system.result");
var uid = vars.get("$sys.uid");
var canDelete = new HasLinkedObjectTester()
.andNoEntityRows("Document_entity", "Documents", {AssignmentTable_param : "TICKET", AssignmentRowId_param : uid}) //Documents
.validate();
result.string(canDelete);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment