File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public static function canCreate() {
60
60
* @return boolean True if he can read requests
61
61
*/
62
62
public static function canView () {
63
- return Session::haveRight (" entity " , UPDATE );
63
+ return Session::haveRight (' entity ' , UPDATE );
64
64
}
65
65
66
66
/**
@@ -69,7 +69,19 @@ public static function canView() {
69
69
* @return boolean True if he can read requests
70
70
*/
71
71
public static function canDelete () {
72
- return Session::haveRight ("entity " , UPDATE );
72
+ return Session::haveRight ('entity ' , UPDATE );
73
+ }
74
+
75
+ public function canPurgeItem () {
76
+ $ DbUtil = new DbUtils ();
77
+
78
+ $ criteria = [
79
+ PluginFormcreatorForm::getForeignKeyField () => $ this ->getID (),
80
+ ];
81
+ if ($ DbUtil ->countElementsInTable (PluginFormcreatorForm_Answer::getTable (), $ criteria ) > 0 ) {
82
+ return false ;
83
+ }
84
+ return Session::haveRight ('entity ' , UPDATE );
73
85
}
74
86
75
87
/**
You can’t perform that action at this time.
0 commit comments