irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libirods_rule_engine_plugin-cpp_default_policy.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 // irods includes
3 #include "msParam.h"
4 #include "reGlobalsExtern.hpp"
5 #include "generalAdmin.h"
6 #include "miscServerFunct.hpp"
7 
8 // =-=-=-=-=-=-=-
10 #include "irods_file_object.hpp"
16 #include "irods_stacktrace.hpp"
17 #include "irods_re_plugin.hpp"
19 #include "irods_re_structs.hpp"
20 
21 // =-=-=-=-=-=-=-
22 // stl includes
23 #include <iostream>
24 #include <sstream>
25 #include <vector>
26 #include <string>
27 
28 // =-=-=-=-=-=-=-
29 // boost includes
30 #include <boost/lexical_cast.hpp>
31 #include <boost/function.hpp>
32 #include <boost/any.hpp>
33 
34 #include "configuration.hpp"
36 #include "json.hpp"
37 
38 #define STATIC_PEP(NAME) static_policy_enforcement_points[#NAME] = NAME
39 
40 typedef std::function< irods::error (irods::callback, std::list<boost::any>&) > pep_opr_t;
41 
42 static std::map< std::string, pep_opr_t > static_policy_enforcement_points;
43 
44 const std::string DEFAULT_RULE_REGEX = "ac[^ ]*";
45 
47  ruleExecInfo_t* rei{nullptr};
48  irods::error ret{_cb(std::string("unsafe_ms_ctx"), &rei)};
49  if (!ret.ok()) {
50  THROW(ret.code(), "failed to get rei");
51  }
52 
53  return *rei;
54 }
55 
57  rsComm_t* rs_comm{nullptr};
58  rs_comm = _rei.rsComm;
59 
60  if (!rs_comm) {
61  THROW(-1, "null rs_comm");
62  }
63 
64  return *rs_comm;
65 }
66 
68  userInfo_t* uoio{nullptr};
69  uoio = _rei.uoio;
70 
71  if (!uoio) {
72  THROW(-1, "null other user info object");
73  }
74 
75  return *uoio;
76 }
77 
78 static std::string get_string_array_from_array( const boost::any& _array ) {
79  std::string str_array;
80  try {
81  for( const auto& elem : boost::any_cast< const std::vector< boost::any >& >( _array ) ) {
82  try {
83  str_array += boost::any_cast< const std::string& >( elem );
84  }
85  catch ( const boost::bad_any_cast& ) {
86  rodsLog(
87  LOG_ERROR,
88  "%s - failed to cast rule base file name entry to string",
89  __PRETTY_FUNCTION__ );
90  continue;
91  }
92 
93  str_array += ",";
94  } // for
95 
96  str_array = str_array.substr( 0, str_array.size() - 1 );
97  return str_array;
98  } catch ( const boost::bad_any_cast& ) {
99  THROW(
101  "failed to any_cast to vector" );
102  }
103 }
104 // =-=-=-=-=-=-=-
105 // implementations of static policy enforcement points from legacy core.re
106 
107 irods::error printHello( irods::callback _cb, std::list<boost::any>& ) {
108 // printHello { print_hello; }
109  return _cb(std::string("print_hello"));
110 }
111 
112 irods::error acPreConnect( irods::callback _cb, std::list<boost::any>& _params ) {
113 // acPreConnect(*OUT) { *OUT="CS_NEG_DONT_CARE"; }
114  for( auto itr : _params ) {
115  if(itr.type() == typeid(std::string*)) {
116  try {
117  *boost::any_cast<std::string*>(itr) = "CS_NEG_DONT_CARE";
118  } catch (const boost::bad_any_cast& e) {
119  rodsLog(LOG_ERROR, "Bad any cast in acPreConnect, [%s]", e.what());
120  return ERROR(
122  "Bad any_cast in acPreConnect()" );
123  }
124  }
125  }
126 
127  return SUCCESS();
128 }
129 
130 irods::error acCreateUser( irods::callback _cb, std::list<boost::any>& ) {
131 /*
132 acCreateUser {
133  acPreProcForCreateUser;
134  acCreateUserF1;
135  acPostProcForCreateUser; }
136 acCreateUserF1 {
137  ON($otherUserName == "anonymous") {
138  msiCreateUser ::: msiRollback;
139  msiCommit; } }
140 acCreateUserF1 {
141  msiCreateUser ::: msiRollback;
142  acCreateDefaultCollections ::: msiRollback;
143  msiAddUserToGroup("public") ::: msiRollback;
144  msiCommit; }
145 */
146  irods::error ret = _cb(std::string("acPreProcForCreateUser"));
147 
148  ret = _cb(std::string("msiCreateUser"));
149  if( !ret.ok() ) {
150  _cb(std::string("msiRollback"));
151  return ret;
152  }
153 
154  std::string other_user_name;
155 
156  try {
157  ruleExecInfo_t& rei{get_rei(_cb)};
158  userInfo_t other_user_info = get_uoio(rei);
159 
160  other_user_name = other_user_info.userName;
161  } catch ( const irods::exception& e ) {
162  irods::log(e);
163  return ERROR(e.code(), "irods exception in acCreateUser");
164  }
165 
166  if (other_user_name != "anonymous") {
167  ret = _cb(std::string("acCreateDefaultCollections"));
168 
169  ret = _cb(std::string("msiAddUserToGroup"), std::string("public"));
170  if ( !ret.ok() ) {
171  _cb(std::string("msiRollback"));
172  return ret;
173  }
174  }
175 
176  ret = _cb(std::string("msiCommit"));
177 
178  ret = _cb(std::string("acPostProcForCreateUser"));
179 
180  return ret;
181 }
182 
184 // acCreateDefaultCollections { acCreateUserZoneCollections; }
185  irods::error ret = _cb(std::string("acCreateUserZoneCollections"));
186  return ret;
187 }
188 
190 // acCreateUserZoneCollections {
191 // acCreateCollByAdmin("/"++$rodsZoneProxy++"/home", $otherUserName);
192 // acCreateCollByAdmin("/"++$rodsZoneProxy++"/trash/home", $otherUserName); }
193  std::string rods_zone_proxy;
194  std::string other_user_name;
195 
196  try {
197  ruleExecInfo_t& rei{get_rei(_cb)};
198  rsComm_t& rs_comm{get_rs_comm(rei)};
199 
200  userInfo_t user_info;
201  user_info = rs_comm.proxyUser;
202 
203  userInfo_t other_user_info = get_uoio(rei);
204 
205  rods_zone_proxy = user_info.rodsZone;
206  other_user_name = other_user_info.userName;
207  } catch ( const irods::exception& e ) {
208  irods::log(e);
209  return ERROR(e.code(), "irods exception in acCreateDefaultCollections");
210  }
211 
212  std::string home_coll = "/" + rods_zone_proxy + "/home";
213  std::string trash_coll = "/" + rods_zone_proxy + "/trash/home";
214 
215  irods::error ret = _cb(std::string("acCreateCollByAdmin"), home_coll, other_user_name);
216  ret = _cb(std::string("acCreateCollByAdmin"), trash_coll, other_user_name);
217  return ret;
218 }
219 
220 irods::error acCreateCollByAdmin( irods::callback _cb, std::list<boost::any>& _params) {
221 // acCreateCollByAdmin(*parColl, *childColl) {
222 // msiCreateCollByAdmin(*parColl, *childColl); }
223  std::string parent_coll;
224  std::string child_coll;
225  int i = 0;
226  for (auto& param: _params) {
227  try {
228  std::string tmp = boost::any_cast<std::string>(param);
229 
230  if (i == 0) {
231  parent_coll = tmp;
232  } else if (i == 1) {
233  child_coll = tmp;
234  }
235 
236  i++;
237  } catch (const boost::bad_any_cast& e) {
238  rodsLog(LOG_ERROR, "Bad any cast on param %d in acCreateCollByAdmin", i);
239  }
240  }
241 
242  irods::error ret = _cb(std::string("msiCreateCollByAdmin"), parent_coll, child_coll);
243  return ret;
244 }
245 
246 irods::error acDeleteUser( irods::callback _cb, std::list<boost::any>& ) {
247 /*
248 acDeleteUser {
249  acPreProcForDeleteUser;
250  acDeleteUserF1;
251  acPostProcForDeleteUser; }
252 acDeleteUserF1 {
253  acDeleteDefaultCollections ::: msiRollback;
254  msiDeleteUser ::: msiRollback;
255  msiCommit; }
256 */
257  irods::error ret = _cb(std::string("acPreProcForDeleteUser"));
258 
259  ret = _cb(std::string("acDeleteDefaultCollections"));
260  if( !ret.ok() ) {
261  _cb(std::string("msiRollback"));
262  return ret;
263  }
264 
265  ret = _cb(std::string("msiDeleteUser"));
266  if( !ret.ok() ) {
267  _cb(std::string("msiRollback"));
268  return ret;
269  }
270 
271  ret = _cb(std::string("msiCommit"));
272 
273  ret = _cb(std::string("acPostProcForDeleteUser"));
274 
275  return ret;
276 }
277 
279 //acDeleteDefaultCollections {
280 // acDeleteUserZoneCollections; }
281  irods::error ret = _cb(std::string("acDeleteUserZoneCollections"));
282  return ret;
283 }
284 
286 //acDeleteUserZoneCollections {
287 // acDeleteCollByAdminIfPresent("/"++$rodsZoneProxy++"/home",$otherUserName);
288 // acDeleteCollByAdminIfPresent("/"++$rodsZoneProxy++"/trash/home",$otherUserName); }
289  std::string rods_zone_proxy;
290  std::string other_user_name;
291 
292  try {
293  ruleExecInfo_t& rei{get_rei(_cb)};
294  rsComm_t& rs_comm{get_rs_comm(rei)};
295 
296  userInfo_t user_info;
297  user_info = rs_comm.proxyUser;
298 
299  userInfo_t other_user_info = get_uoio(rei);
300 
301  rods_zone_proxy = user_info.rodsZone;
302  other_user_name = other_user_info.userName;
303  } catch ( const irods::exception& e ) {
304  irods::log(e);
305  return ERROR(e.code(), "irods exception in acDeleteDefaultCollections");
306  }
307 
308  std::string home_coll = "/" + rods_zone_proxy + "/home";
309  std::string trash_coll = "/" + rods_zone_proxy + "/trash/home";
310 
311  irods::error ret = _cb(std::string("acDeleteCollByAdminIfPresent"), home_coll, other_user_name);
312  ret = _cb(std::string("acDeleteCollByAdminIfPresent"), trash_coll, other_user_name);
313  return ret;
314 }
315 
316 irods::error acDeleteCollByAdminIfPresent( irods::callback _cb, std::list<boost::any>& _params ) {
317 //acDeleteCollByAdminIfPresent(*parColl, *childColl) {
318 // *status=errormsg(msiDeleteCollByAdmin(*parColl,*childColl), *msg);
319 // if (*status != 0 && *status != -808000) {
320 // failmsg(*status,*msg) } }
321  std::string parent_coll;
322  std::string child_coll;
323  int i = 0;
324  for (auto& param: _params) {
325  try {
326  std::string tmp = boost::any_cast<std::string>(param);
327 
328  if (i == 0) {
329  parent_coll = tmp;
330  } else if (i == 1) {
331  child_coll = tmp;
332  }
333 
334  i++;
335  } catch (const boost::bad_any_cast& e) {
336  rodsLog(LOG_ERROR, "Bad any cast on param [%d] in acDeleteCollByAdminIfPresent", i);
337  }
338  }
339 
340 
341  irods::error ret = _cb(std::string("acDeleteCollByAdmin"), parent_coll, child_coll);
342  if (!ret.ok() && ret.code() != CAT_NO_ROWS_FOUND) {
343  return ret;
344  }
345 
346  return SUCCESS();
347 }
348 
349 irods::error acDeleteCollByAdmin( irods::callback _cb, std::list<boost::any>& _params) {
350 //acDeleteCollByAdmin(*parColl,*childColl) {
351 // msiDeleteCollByAdmin(*parColl,*childColl); }
352  std::string parent_coll;
353  std::string child_coll;
354  int i = 0;
355  for (auto& param: _params) {
356  try {
357  std::string tmp = boost::any_cast<std::string>(param);
358 
359  if (i == 0) {
360  parent_coll = tmp;
361  } else if (i == 1) {
362  child_coll = tmp;
363  }
364 
365  i++;
366  } catch (const boost::bad_any_cast& e) {
367  rodsLog(LOG_ERROR, "Bad any cast on param [%d] in acDeleteCollByAdmin", i);
368  }
369  }
370 
371  irods::error ret = _cb(std::string("msiDeleteCollByAdmin"), parent_coll, child_coll);
372  return ret;
373 }
374 
375 irods::error acRenameLocalZone( irods::callback _cb, std::list<boost::any>& ) {
376 // msiRenameCollection ::: msiRollback;
377 // msiRenameLocalZone ::: msiRenameLocalZone;
378 // msiCommit;
379  irods::error ret = _cb(std::string("msiRenameCollection"));
380  if( !ret.ok() ) {
381  _cb(std::string("msiRollback"));
382  return ret;
383  }
384 
385  ret = _cb(std::string("msiRenameLocalZone"));
386  if( !ret.ok() ) {
387  _cb(std::string("msiRollback"));
388  return ret;
389  }
390 
391  ret = _cb(std::string("msiCommit"));
392 
393  return ret;
394 }
395 
396 irods::error acGetUserByDN( irods::callback, std::list<boost::any>& ) {
397  return SUCCESS();
398 }
399 
400 irods::error acAclPolicy( irods::callback _cb, std::list<boost::any>& ) {
401  //msiAclPolicy("STRICT");
402  return _cb(std::string("msiAclPolicy"), std::string("STRICT"));
403 }
404 
405 irods::error acTicketPolicy( irods::callback, std::list<boost::any>& ) {
406  return SUCCESS();
407 }
408 
410  return SUCCESS();
411 }
412 
413 irods::error acSetRescSchemeForCreate( irods::callback _cb, std::list<boost::any>& ) {
414 //msiSetDefaultResc("demoResc","null");
415 /*
416  props.capture_if_needed();
417  irods::server_properties& props = irods::server_properties::instance();
418  irods::error ret = props.get_property<std::string>("default_resource_name", resc_name);
419  if( !ret.ok() ) {
420  resc_name = "demoResc";
421  }
422 */
423  std::string resc_name = "demoResc";
424  try {
425  resc_name = irods::server_properties::instance().get_property<std::string>("default_resource_name");
426  } catch ( const irods::exception& ) {
427  rodsLog(
428  LOG_NOTICE,
429  "No default_resource_name in server properties - using 'demoResc'");
430  }
431 
432  return _cb(std::string("msiSetDefaultResc"), resc_name, std::string("null"));
433 }
434 
435 irods::error acSetRescSchemeForRepl( irods::callback _cb, std::list<boost::any>& ) {
436 //msiSetDefaultResc("demoResc","null");
437 /*
438  irods::server_properties& props = irods::server_properties::instance();
439  props.capture_if_needed();
440  std::string resc_name;
441  irods::error ret = props.get_property<std::string>("default_resource_name", resc_name);
442  if( !ret.ok() ) {
443  resc_name = "demoResc";
444  }
445 */
446  std::string resc_name = "demoResc";
447  try {
448  resc_name = irods::server_properties::instance().get_property<std::string>("default_resource_name");
449  } catch ( const irods::exception& ) {
450  rodsLog(
451  LOG_NOTICE,
452  "No default_resource_name in server properties - using 'demoResc'");
453  }
454 
455  return _cb(std::string("msiSetDefaultResc"), resc_name, std::string("null"));
456 }
457 
459  return SUCCESS();
460 }
461 
463  return SUCCESS();
464 }
465 
466 irods::error acPostProcForPut( irods::callback, std::list<boost::any>& ) {
467  return SUCCESS();
468 }
469 
470 irods::error acPostProcForCopy( irods::callback, std::list<boost::any>& ) {
471  return SUCCESS();
472 }
473 
475  return SUCCESS();
476 }
477 
479  return SUCCESS();
480 }
481 
482 irods::error acPostProcForOpen( irods::callback, std::list<boost::any>& ) {
483  return SUCCESS();
484 }
485 
486 irods::error acPostProcForPhymv( irods::callback, std::list<boost::any>& ) {
487  return SUCCESS();
488 }
489 
490 irods::error acPostProcForRepl( irods::callback, std::list<boost::any>& ) {
491  return SUCCESS();
492 }
493 
494 irods::error acSetNumThreads( irods::callback _cb, std::list<boost::any>& ) {
495 //msiSetNumThreads("default","64","default");
496  return _cb(std::string("msiSetNumThreads"), std::string("default"), std::string("64"), std::string("default"));
497 }
498 
499 irods::error acDataDeletePolicy( irods::callback, std::list<boost::any>& ) {
500  return SUCCESS();
501 }
502 
504  return SUCCESS();
505 }
506 
507 irods::error acSetChkFilePathPerm( irods::callback _cb, std::list<boost::any>& ) {
508 //msiSetChkFilePathPerm("disallowPathReg");
509  return _cb(std::string("msiSetChkFilePathPerm"), std::string("disallowPathReg"));
510 }
511 
512 irods::error acTrashPolicy( irods::callback, std::list<boost::any>& ) {
513  return SUCCESS();
514 }
515 
517  return SUCCESS();
518 }
519 
521  return SUCCESS();
522 }
523 
524 irods::error acSetVaultPathPolicy( irods::callback _cb, std::list<boost::any>& ) {
525  //msiSetGraftPathScheme("no","1");
526  return _cb(std::string("msiSetGraftPathScheme"), std::string("no"), std::string("1"));
527 }
528 
529 irods::error acSetReServerNumProc( irods::callback _cb, std::list<boost::any>& ) {
530  //msiSetReServerNumProc("default");
531  return _cb(std::string("msiSetReServerNumProc"), std::string("default"));
532 }
533 
535  return SUCCESS();
536 }
537 
539  return SUCCESS();
540 }
541 
542 irods::error acPreprocForRmColl( irods::callback, std::list<boost::any>& ) {
543  return SUCCESS();
544 }
545 
547  return SUCCESS();
548 }
549 
551  return SUCCESS();
552 }
553 
555  return SUCCESS();
556 }
557 
559  return SUCCESS();
560 }
561 
563  return SUCCESS();
564 }
565 
567  return SUCCESS();
568 }
569 
571  return SUCCESS();
572 }
573 
575  return SUCCESS();
576 }
577 
579  return SUCCESS();
580 }
581 
583  return SUCCESS();
584 }
585 
587  return SUCCESS();
588 }
589 
591  return SUCCESS();
592 }
593 
595  return SUCCESS();
596 }
597 
599  return SUCCESS();
600 }
601 
603  return SUCCESS();
604 }
605 
607  return SUCCESS();
608 }
609 
611  return SUCCESS();
612 }
613 
615  return SUCCESS();
616 }
617 
619  return SUCCESS();
620 }
621 
623  return SUCCESS();
624 }
625 
627  return SUCCESS();
628 }
629 
631  return SUCCESS();
632 }
633 
635  return SUCCESS();
636 }
637 
639  return SUCCESS();
640 }
641 
643  return SUCCESS();
644 }
645 
647  return SUCCESS();
648 }
649 
651  return SUCCESS();
652 }
653 
655  return SUCCESS();
656 }
657 
659  return SUCCESS();
660 }
661 
663  return SUCCESS();
664 }
665 
667  return SUCCESS();
668 }
669 
670 irods::error acRescQuotaPolicy( irods::callback _cb, std::list<boost::any>& ) {
671  return _cb(std::string("msiSetRescQuotaPolicy"), std::string("off"));
672 }
673 
674 irods::error acBulkPutPostProcPolicy ( irods::callback _cb, std::list<boost::any>& ) {
675  return _cb(std::string("msiSetBulkPutPostProcPolicy"), std::string("off"));
676 }
677 
679  return SUCCESS();
680 }
681 
683  return SUCCESS();
684 }
685 
687  return SUCCESS();
688 }
689 
691  return SUCCESS();
692 }
693 
695  return SUCCESS();
696 }
697 
699  return SUCCESS();
700 }
701 
703 //acPreProcForWriteSessionVariable(*var) {
704 // ON(*var == "status") {
705 // succeed;
706 // }
707 // or {
708 // failmsg(-1, "Update session variable $*var not allowed!");
709 // }
710 //}
711  std::string session_var;
712  int i = 0;
713  for (auto& param: _params) {
714  try {
715  std::string tmp = boost::any_cast<std::string>(param);
716 
717  if (i == 0) {
718  session_var = tmp;
719  break;
720  }
721 
722  i++;
723  } catch (const boost::bad_any_cast& e) {
724  rodsLog(LOG_ERROR, "Bad any cast on param [%d] in acPreProcForWriteSessionVar", i);
725  }
726  }
727 
728  if (session_var == "status") {
729  return SUCCESS();
730  } else {
731  return ERROR(SYS_INVALID_INPUT_PARAM, "Updating session variable $" + session_var + " is not allowed");
732  }
733 }
734 
736  return SUCCESS();
737 }
738 
740  return SUCCESS();
741 }
742 
743 irods::error acSetCreateConditions( irods::callback _cb, std::list<boost::any>& ) {
744 // msiGetNewObjDescriptor ::: recover_msiGetNewObjDescriptor; acSetResourceList;
745  irods::error ret = _cb(std::string("msiGetNewObjDescriptor"));
746  if( !ret.ok() ) {
747  _cb(std::string("recover_msiGetNewObjDescriptor"));
748  return ret;
749  }
750 
751  ret = _cb(std::string("acSetResourceList"));
752 
753  return ret;
754 }
755 
756 irods::error acDOC( irods::callback _cb, std::list<boost::any>& ) {
757 // msiPhyDataObjCreate ::: recover_msiPhyDataObjCreate; acRegisterData ::: msiRollback; msiCommit;
758  irods::error ret = _cb(std::string("msiPhyDataObjCreate"));
759  if( !ret.ok() ) {
760  _cb(std::string("recover_msiPhyDataObjCreate"));
761  return ret;
762  }
763 
764  ret = _cb(std::string("acRegisterData"));
765  if( !ret.ok() ) {
766  _cb(std::string("msiRollback"));
767  return ret;
768  }
769 
770  ret = _cb(std::string("msiCommit"));
771 
772  return ret;
773 }
774 
775 irods::error acSetResourceList( irods::callback _cb, std::list<boost::any>& ) {
776 // msiSetResourceList;
777  return _cb(std::string("msiSetResourceList"));
778 }
779 
780 irods::error acSetCopyNumber( irods::callback _cb, std::list<boost::any>& ) {
781 // msiSetCopyNumber;
782  return _cb(std::string("msiSetCopyNumber"));
783 }
784 
785 irods::error acRegisterData( irods::callback _cb, std::list<boost::any>& ) {
786 // msiRegisterData ::: msiRollback
787  irods::error ret = _cb(std::string("msiRegisterData"));
788  if( !ret.ok() ) {
789  _cb(std::string("msiRollback"));
790  return ret;
791  }
792 
793  return ret;
794 }
795 
796 irods::error start(irods::default_re_ctx& _u, const std::string& _instance_name) {
797  (void) _u;
880  STATIC_PEP(acDOC);
884 
885  // Can just do it, since this rule engine is pre-compiled
887 
888 
889  return SUCCESS();
890 }
891 
892 irods::error stop(irods::default_re_ctx& _u, const std::string&) {
893  (void) _u;
894  return SUCCESS();
895 }
896 irods::error rule_exists(irods::default_re_ctx&, const std::string& _rn, bool& _ret) {
897  _ret = ( static_policy_enforcement_points.find(_rn) !=
899  return SUCCESS();
900 }
901 
902 irods::error list_rules(irods::default_re_ctx&, std::vector<std::string>& rule_vec) {
903  for (auto& map_entry : static_policy_enforcement_points) {
904  rule_vec.push_back(map_entry.first);
905  }
906 
907  return SUCCESS();
908 }
909 
912  const std::string& _rn,
913  std::list<boost::any>& _ps,
914  irods::callback _eff_hdlr) {
915  ruleExecInfo_t * rei;
916  irods::error err;
917 
918  if(!(err = _eff_hdlr("unsafe_ms_ctx", &rei)).ok()) {
919  return err;
920  }
921 
922  if(static_policy_enforcement_points.find(_rn) !=
924  return static_policy_enforcement_points[_rn](_eff_hdlr,_ps);
925  }
926  else {
927  rodsLog(
928  LOG_ERROR,
929  "[%s] not defined in default rule engine",
930  _rn.c_str() );
931  return SUCCESS();
932  }
933 } // exec_rule
934 
935 namespace {
936  auto collapse_error_stack(rError_t& _error) -> std::string {
937  std::stringstream ss;
938  for(int i = 0; i < _error.len; ++i) {
939  rErrMsg_t* err_msg = _error.errMsg[i];
940  if(err_msg->status != STDOUT_STATUS) {
941  ss << "status: " << err_msg->status << " ";
942  }
943 
944  ss << err_msg->msg << " - ";
945  }
946  return ss.str();
947  } // collapse_error_stack
948 
949  void invoke_policy(
950  ruleExecInfo_t* _rei,
951  const std::string& _action,
952  std::list<boost::any>& _args) {
954  irods::unit,
956  irods::AUDIT_RULE> re_ctx_mgr(
957  irods::re_plugin_globals->global_re_mgr,
958  _rei);
959  irods::error err = re_ctx_mgr.exec_rule(_action, irods::unpack(_args));
960  if(!err.ok()) {
961  if(_rei->status < 0) {
962  std::string msg = collapse_error_stack(_rei->rsComm->rError);
963  THROW(_rei->status, msg);
964  }
965 
966  THROW(err.code(), err.result());
967  }
968  } // invoke_policy
969 } // namespace
970 
971 int _delayExec(const char* rule, const char* recov, const char* condition, ruleExecInfo_t*);
972 
975  const std::string& _rule_text,
976  msParamArray_t* _ms_params,
977  const std::string& _out_desc,
978  irods::callback _eff_hdlr) {
979 
980  using json = nlohmann::json;
981 
982  ruleExecInfo_t* rei;
983  irods::error err;
984  if(!(err = _eff_hdlr("unsafe_ms_ctx", &rei)).ok()) {
985  return err;
986  }
987 
988  try {
989  // skip the first line: @external
990  std::string rule_text{_rule_text};
991  if(_rule_text.find("@external") != std::string::npos) {
992  rule_text = _rule_text.substr(10);
993  }
994 
995  auto rule{json::parse(rule_text)};
996  std::string policy = rule["policy"];
997  if(policy.empty()) {
998  return ERROR(
1000  "exec_rule_text : policy is not supported");
1001  }
1002 
1003  auto payload{rule["payload"]};
1004  if(payload.empty()) {
1005  return ERROR(
1007  "exec_rule_text : payload is empty");
1008  }
1009 
1010  if("irods_policy_enqueue_rule" == policy) {
1011  std::string delay_cond{rule["delay_conditions"]};
1012 
1013  const auto err = _delayExec(payload.dump().c_str(), "",
1014  delay_cond.c_str(), rei);
1015  if(err < 0) {
1016  return ERROR(err, "delayExec failed");
1017  }
1018  }
1019  else {
1020  std::string policy_to_invoke{payload["policy_to_invoke"]};
1021  std::string parameter_string{payload["parameters"].dump()};
1022  std::string configuration_string{payload["configuration"].dump()};
1023 
1024  std::list<boost::any> arguments;
1025  arguments.push_back(boost::any(std::ref(parameter_string)));
1026  arguments.push_back(boost::any(std::ref(configuration_string)));
1027 
1028  invoke_policy(rei, policy_to_invoke, arguments);
1029  }
1030  }
1031  catch(const json::exception& e) {
1032  addRErrorMsg(
1033  &rei->rsComm->rError,
1035  e.what());
1036  return ERROR(
1038  e.what());
1039  }
1040  catch(const irods::exception& e) {
1041  addRErrorMsg(
1042  &rei->rsComm->rError,
1044  e.what());
1045  return ERROR(
1047  e.what());
1048  }
1049  catch(const std::exception& e) {
1050  addRErrorMsg(
1051  &rei->rsComm->rError,
1053  e.what());
1054  return ERROR(
1056  e.what());
1057  }
1058 
1059  return SUCCESS();//CODE(RULE_ENGINE_CONTINUE);
1060 
1061 } // exec_rule_text
1062 
1065  const std::string& _rule_text,
1066  msParamArray_t* _ms_params,
1067  irods::callback _eff_hdlr) {
1068 
1069  using json = nlohmann::json;
1070 
1071  ruleExecInfo_t* rei;
1072  irods::error err;
1073  if(!(err = _eff_hdlr("unsafe_ms_ctx", &rei)).ok()) {
1074  return err;
1075  }
1076 
1077  try {
1078  json rule{json::parse(_rule_text)};
1079  std::string policy = rule["policy"];
1080  if(policy.empty() || "irods_policy_execute_rule" != policy) {
1081  return ERROR(
1083  "exec_rule_text is not supported");
1084  }
1085 
1086  auto payload{rule["payload"]};
1087  if(payload.empty()) {
1088  return ERROR(
1090  "exec_rule_text is not supported");
1091  }
1092 
1093  std::string policy_to_invoke{payload["policy_to_invoke"]};
1094  std::string parameter_string{payload["parameters"].dump()};
1095  std::string configuration_string{payload["configuration"].dump()};
1096 
1097  std::list<boost::any> arguments;
1098  arguments.push_back(boost::any(std::ref(parameter_string)));
1099  arguments.push_back(boost::any(std::ref(configuration_string)));
1100  invoke_policy(rei, policy_to_invoke, arguments);
1101  }
1102  catch(const json::exception& e) {
1103  addRErrorMsg(
1104  &rei->rsComm->rError,
1106  e.what());
1107  return ERROR(
1109  e.what());
1110  }
1111  catch(const irods::exception& e) {
1112  addRErrorMsg(
1113  &rei->rsComm->rError,
1115  e.what());
1116  return ERROR(
1118  e.what());
1119  }
1120  catch(const std::exception& e) {
1121  addRErrorMsg(
1122  &rei->rsComm->rError,
1124  e.what());
1125  return ERROR(
1127  e.what());
1128  }
1129  return SUCCESS();//CODE(RULE_ENGINE_CONTINUE);
1130 
1131 } // exec_rule_expression
1132 
1133 extern "C"
1135  const std::string& _context ) {
1137  re->add_operation( "start",
1138  std::function<irods::error(irods::default_re_ctx&, const std::string&)>( start ) );
1139 
1140  re->add_operation( "stop",
1141  std::function<irods::error(irods::default_re_ctx&, const std::string&)>( stop ) );
1142 
1143  re->add_operation( "rule_exists",
1144  std::function<irods::error(irods::default_re_ctx&, const std::string&, bool&)>( rule_exists ) );
1145 
1146  re->add_operation( "list_rules",
1147  std::function<irods::error(irods::default_re_ctx&, std::vector<std::string>&)>( list_rules ) );
1148 
1149  re->add_operation( "exec_rule",
1150  std::function<irods::error(irods::default_re_ctx&,const std::string&,std::list<boost::any>&,irods::callback)>( exec_rule ) );
1151 
1152  re->add_operation( "exec_rule_text",
1153  std::function<irods::error(irods::default_re_ctx&,const std::string&,msParamArray_t*,const std::string&,irods::callback)>( exec_rule_text ) );
1154 
1155  re->add_operation( "exec_rule_expression",
1156  std::function<irods::error(irods::default_re_ctx&,const std::string&,msParamArray_t*,irods::callback)>( exec_rule_expression ) );
1157 
1158  return re;
1159 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
acSetCreateConditions
irods::error acSetCreateConditions(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:743
irods::unit
std::tuple<> unit
Definition: irods_re_plugin.hpp:736
irods_physical_object.hpp
rsComm_t
Definition: rcConnect.h:145
acPreProcForModifyAccessControl
irods::error acPreProcForModifyAccessControl(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:646
acPreProcForModifyAVUMetadata
irods::error acPreProcForModifyAVUMetadata(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:558
acPreProcForModifyResource
irods::error acPreProcForModifyResource(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:622
acDeleteUserZoneCollections
irods::error acDeleteUserZoneCollections(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:285
acPreProcForObjRename
irods::error acPreProcForObjRename(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:654
acCreateUser
irods::error acCreateUser(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:130
RuleExistsHelper::Instance
static RuleExistsHelper * Instance()
Definition: irods_re_ruleexistshelper.cpp:6
rErrMsg_t
Definition: rodsError.h:19
irods_server_properties.hpp
THROW
#define THROW(_code, _msg)
Definition: irods_exception.hpp:68
acDeleteDefaultCollections
irods::error acDeleteDefaultCollections(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:278
acPostProcForFilePathReg
irods::error acPostProcForFilePathReg(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:474
msParam.h
acPreProcForDeleteToken
irods::error acPreProcForDeleteToken(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:614
userInfo_t
Definition: rodsUser.h:65
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
acPostProcForDataObjRead
irods::error acPostProcForDataObjRead(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:686
irods::rule_engine_context_manager
Definition: irods_re_plugin.hpp:522
irods_file_object.hpp
irods_stacktrace.hpp
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
acPreProcForDeleteResource
irods::error acPreProcForDeleteResource(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:606
acPreprocForCollCreate
irods::error acPreprocForCollCreate(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:534
acBulkPutPostProcPolicy
irods::error acBulkPutPostProcPolicy(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:674
irods_collection_object.hpp
acPreProcForModifyCollMeta
irods::error acPreProcForModifyCollMeta(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:630
acPostProcForDataCopyReceived
irods::error acPostProcForDataCopyReceived(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:739
rErrMsg_t::status
int status
Definition: rodsError.h:20
generalAdmin.h
configuration.hpp
acGetUserByDN
irods::error acGetUserByDN(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:396
exec_rule_expression
irods::error exec_rule_expression(irods::default_re_ctx &, const std::string &_rule_text, msParamArray_t *_ms_params, irods::callback _eff_hdlr)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:1063
irods::unpack
Definition: irods_re_plugin.hpp:66
acPostProcForGenQuery
irods::error acPostProcForGenQuery(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:666
acDeleteCollByAdminIfPresent
irods::error acDeleteCollByAdminIfPresent(irods::callback _cb, std::list< boost::any > &_params)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:316
static_policy_enforcement_points
static std::map< std::string, pep_opr_t > static_policy_enforcement_points
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:42
acPostProcForPut
irods::error acPostProcForPut(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:466
exec_rule_text
irods::error exec_rule_text(irods::default_re_ctx &, const std::string &_rule_text, msParamArray_t *_ms_params, const std::string &_out_desc, irods::callback _eff_hdlr)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:973
list_rules
irods::error list_rules(irods::default_re_ctx &, std::vector< std::string > &rule_vec)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:902
acPostProcForCreateUser
irods::error acPostProcForCreateUser(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:570
acTrashPolicy
irods::error acTrashPolicy(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:512
acPreProcForCreateResource
irods::error acPreProcForCreateResource(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:582
acSetResourceList
irods::error acSetResourceList(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:775
reGlobalsExtern.hpp
acPreProcForExecCmd
irods::error acPreProcForExecCmd(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:690
json
nlohmann::json json
Definition: group.cpp:5
irods::pluggable_rule_engine
Definition: irods_re_plugin.hpp:169
irods_re_ruleexistshelper.hpp
acPostProcForTarFileReg
irods::error acPostProcForTarFileReg(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:678
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
stop
irods::error stop(irods::default_re_ctx &_u, const std::string &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:892
acPostProcForRepl
irods::error acPostProcForRepl(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:490
irods_resource_redirect.hpp
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
acPostProcForModifyResource
irods::error acPostProcForModifyResource(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:626
_delayExec
int _delayExec(const char *rule, const char *recov, const char *condition, ruleExecInfo_t *)
Definition: nre.systemMS.cpp:158
irods_re_plugin.hpp
acPreProcForModifyDataObjMeta
irods::error acPreProcForModifyDataObjMeta(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:638
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
acDOC
irods::error acDOC(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:756
acPostProcForServerPortal
irods::error acPostProcForServerPortal(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:698
irods_resource_plugin.hpp
acPostProcForPhymv
irods::error acPostProcForPhymv(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:486
SYS_NOT_SUPPORTED
@ SYS_NOT_SUPPORTED
Definition: rodsErrorTable.h:133
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
acSetRescSchemeForRepl
irods::error acSetRescSchemeForRepl(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:435
irods_string_tokenize.hpp
rule_exists
irods::error rule_exists(irods::default_re_ctx &, const std::string &_rn, bool &_ret)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:896
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
irods::error::code
long long code() const
Definition: irods_error.cpp:194
acPostProcForModifyDataObjMeta
irods::error acPostProcForModifyDataObjMeta(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:642
rError_t
Definition: rodsError.h:24
acPostProcForRmColl
irods::error acPostProcForRmColl(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:546
start
irods::error start(irods::default_re_ctx &_u, const std::string &_instance_name)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:796
acPreProcForCreateUser
irods::error acPreProcForCreateUser(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:566
acPostProcForDeleteToken
irods::error acPostProcForDeleteToken(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:618
DEFAULT_RULE_REGEX
const std::string DEFAULT_RULE_REGEX
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:44
acPostProcForCreateToken
irods::error acPostProcForCreateToken(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:594
plugin_factory
irods::pluggable_rule_engine< irods::default_re_ctx > * plugin_factory(const std::string &_inst_name, const std::string &_context)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:1134
exec_rule
irods::error exec_rule(irods::default_re_ctx &, const std::string &_rn, std::list< boost::any > &_ps, irods::callback _eff_hdlr)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:910
acAclPolicy
irods::error acAclPolicy(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:400
acPostProcForDeleteResource
irods::error acPostProcForDeleteResource(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:610
acSetReServerNumProc
irods::error acSetReServerNumProc(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:529
acPostProcForCreateResource
irods::error acPostProcForCreateResource(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:586
acCheckPasswordStrength
irods::error acCheckPasswordStrength(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:409
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
acPreProcForGenQuery
irods::error acPreProcForGenQuery(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:662
get_uoio
userInfo_t get_uoio(ruleExecInfo_t &_rei)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:67
get_rei
ruleExecInfo_t & get_rei(irods::callback &_cb)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:46
irods::AUDIT_RULE
@ AUDIT_RULE
Definition: irods_re_plugin.hpp:124
INVALID_ANY_CAST
@ INVALID_ANY_CAST
Definition: rodsErrorTable.h:771
irods::callback
Definition: irods_re_plugin.hpp:133
rErrMsg_t::msg
char msg[1024]
Definition: rodsError.h:21
addRErrorMsg
int addRErrorMsg(rError_t *myError, int status, const char *msg)
Definition: rcMisc.cpp:121
irods::pluggable_rule_engine::add_operation
error add_operation(const std::string &_op, std::function< error(types_t...)> _f)
Definition: irods_re_plugin.hpp:176
irods::default_re_ctx
unit default_re_ctx
Definition: irods_re_plugin.hpp:739
acDataDeletePolicy
irods::error acDataDeletePolicy(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:499
STDOUT_STATUS
static const int STDOUT_STATUS
Definition: rcMisc.h:327
userInfo_t::rodsZone
char rodsZone[64]
Definition: rodsUser.h:67
acChkHostAccessControl
irods::error acChkHostAccessControl(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:520
RuleExistsHelper::registerRuleRegex
void registerRuleRegex(const std::string &_regex)
Definition: irods_re_ruleexistshelper.cpp:14
irods::log
void log(const error &)
Definition: irods_log.cpp:13
acPostProcForOpen
irods::error acPostProcForOpen(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:482
acCreateCollByAdmin
irods::error acCreateCollByAdmin(irods::callback _cb, std::list< boost::any > &_params)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:220
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
acPostProcForModifyUserGroup
irods::error acPostProcForModifyUserGroup(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:602
RuleExecInfo::uoio
userInfo_t * uoio
Definition: irods_re_structs.hpp:33
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
acPostProcForDelete
irods::error acPostProcForDelete(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:503
acDeleteUser
irods::error acDeleteUser(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:246
miscServerFunct.hpp
acSetMultiReplPerResc
irods::error acSetMultiReplPerResc(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:462
acDeleteCollByAdmin
irods::error acDeleteCollByAdmin(irods::callback _cb, std::list< boost::any > &_params)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:349
acPostProcForObjRename
irods::error acPostProcForObjRename(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:658
acPostProcForCollCreate
irods::error acPostProcForCollCreate(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:538
acSetVaultPathPolicy
irods::error acSetVaultPathPolicy(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:524
acPostProcForParallelTransferReceived
irods::error acPostProcForParallelTransferReceived(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:735
pep_opr_t
std::function< irods::error(irods::callback, std::list< boost::any > &) > pep_opr_t
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:40
irods_hierarchy_parser.hpp
printHello
irods::error printHello(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:107
irods::server_properties::instance
static server_properties & instance()
Definition: irods_server_properties.cpp:30
CAT_NO_ROWS_FOUND
@ CAT_NO_ROWS_FOUND
Definition: rodsErrorTable.h:423
acPostProcForDataObjWrite
irods::error acPostProcForDataObjWrite(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:682
STATIC_PEP
#define STATIC_PEP(NAME)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:38
error
int error
Definition: filesystem.cpp:101
RuleExecInfo
Definition: irods_re_structs.hpp:18
irods_re_structs.hpp
acPreProcForDeleteUser
irods::error acPreProcForDeleteUser(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:574
acSetNumThreads
irods::error acSetNumThreads(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:494
acPostProcForModifyAccessControl
irods::error acPostProcForModifyAccessControl(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:650
acPreConnect
irods::error acPreConnect(irods::callback _cb, std::list< boost::any > &_params)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:112
acSetRescSchemeForCreate
irods::error acSetRescSchemeForCreate(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:413
acTicketPolicy
irods::error acTicketPolicy(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:405
irods::exception
Definition: irods_exception.hpp:15
acPreprocForRmColl
irods::error acPreprocForRmColl(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:542
get_string_array_from_array
static std::string get_string_array_from_array(const boost::any &_array)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:78
acPostProcForModifyAVUMetadata
irods::error acPostProcForModifyAVUMetadata(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:562
acSetChkFilePathPerm
irods::error acSetChkFilePathPerm(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:507
acPostProcForCreate
irods::error acPostProcForCreate(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:478
acSetPublicUserPolicy
irods::error acSetPublicUserPolicy(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:516
irods::server_properties::get_property
T & get_property(const std::string &_key)
Definition: irods_server_properties.hpp:78
acPreProcForModifyUserGroup
irods::error acPreProcForModifyUserGroup(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:598
acPostProcForModifyCollMeta
irods::error acPostProcForModifyCollMeta(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:634
acPreProcForServerPortal
irods::error acPreProcForServerPortal(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:694
acCreateUserZoneCollections
irods::error acCreateUserZoneCollections(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:189
get_rs_comm
rsComm_t & get_rs_comm(ruleExecInfo_t &_rei)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:56
acPreprocForDataObjOpen
irods::error acPreprocForDataObjOpen(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:458
acPostProcForModifyUser
irods::error acPostProcForModifyUser(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:554
MsParamArray
Definition: msParam.h:84
acRenameLocalZone
irods::error acRenameLocalZone(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:375
acRescQuotaPolicy
irods::error acRescQuotaPolicy(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:670
acPreProcForCreateToken
irods::error acPreProcForCreateToken(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:590
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
acRegisterData
irods::error acRegisterData(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:785
acSetCopyNumber
irods::error acSetCopyNumber(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:780
acPreProcForModifyUser
irods::error acPreProcForModifyUser(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:550
irods::error::result
std::string result() const
Definition: irods_error.cpp:201
irods::re_plugin_globals
std::unique_ptr< struct irods::global_re_plugin_mgr > re_plugin_globals
Definition: irods_re_plugin.cpp:16
acCreateDefaultCollections
irods::error acCreateDefaultCollections(irods::callback _cb, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:183
acPostProcForCopy
irods::error acPostProcForCopy(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:470
acPostProcForDeleteUser
irods::error acPostProcForDeleteUser(irods::callback, std::list< boost::any > &)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:578
acPreProcForWriteSessionVariable
irods::error acPreProcForWriteSessionVariable(irods::callback, std::list< boost::any > &_params)
Definition: libirods_rule_engine_plugin-cpp_default_policy.cpp:702