SetPermsByProces.php 683 B

123456789101112131415161718192021222324
  1. <?php
  2. Lib::loadClass('RouteBase');
  3. class Route_PostTask_SetPermsByProces extends RouteBase {
  4. function run() {
  5. $idProces = V::get('id_proces', 0, $_POST, 'int');
  6. if ($idProces <= 0) throw new Exception("Brak Nr Procesu");
  7. if (User::getAcl()->getPermsFiltrProcesId() == $idProces) {
  8. throw new AlertInfoException("Filtr procesu nr {$idProces} jest już uruchomiony");
  9. }
  10. if (!User::getAcl()->canExecuteProcesInit($idProces)) {
  11. throw new AlertInfoException("Brak uprawnień do uruchomienia filtra procesu nr {$idProces}");
  12. }
  13. User::getAcl()->fetchProcesPerms($idProces, true);
  14. throw new AlertSuccessException("Uruchomiono filtr procesu nr {$idProces}");
  15. }
  16. }