File tree Expand file tree Collapse file tree
core/components/fileman/src/Processors/File Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace FileMan \Processors \File ;
44
5- use MODX \Revolution \Processors \Model \GetProcessor ;
65use FileMan \Model \File ;
7- use MODX \Revolution \Processors \ModelProcessor ;
6+ use MODX \Revolution \Processors \Model \ UpdateProcessor ;
87
9- class Hash extends ModelProcessor
8+ class Hash extends UpdateProcessor
109{
1110 public $ objectType = 'File ' ;
1211 public $ classKey = File::class;
@@ -17,22 +16,14 @@ class Hash extends ModelProcessor
1716 public $ object ;
1817
1918 /**
20- * We doing special check of permission
21- * because of our objects is not an instances of modAccessibleObject
22- *
23- * @return mixed
19+ * @return bool
2420 */
25- public function process ()
21+ public function beforeSet ()
2622 {
27- if (!$ this ->checkPermissions ()) {
28- return $ this ->failure ($ this ->modx ->lexicon ('access_denied ' ));
29- }
30-
3123 $ hash = sha1 ($ this ->object ->getFullPath ());
3224
33- $ this ->object ->set ('hash ' , $ hash );
34- $ this ->object ->save ();
25+ $ this ->setProperty ('hash ' , $ hash );
3526
36- return $ this -> success ( '' , array ( ' hash ' => $ hash ) );
27+ return parent :: beforeSet ( );
3728 }
3829}
You can’t perform that action at this time.
0 commit comments