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() {
6060 * @return boolean True if he can read requests
6161 */
6262 public static function canView () {
63- return Session::haveRight (" entity " , UPDATE );
63+ return Session::haveRight (' entity ' , UPDATE );
6464 }
6565
6666 /**
@@ -69,7 +69,19 @@ public static function canView() {
6969 * @return boolean True if he can read requests
7070 */
7171 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 );
7385 }
7486
7587 /**
You can’t perform that action at this time.
0 commit comments