1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Users\Roles;
13
14 15 16
17 class DeleteOperation extends \ICanBoogie\DeleteOperation
18 {
19 20 21 22 23 24
25 protected function get_controls()
26 {
27 return array
28 (
29 self::CONTROL_PERMISSION => Module::PERMISSION_ADMINISTER,
30 self::CONTROL_OWNERSHIP => false
31 )
32
33 + parent::get_controls();
34 }
35
36 37 38
39 protected function validate(\ICanboogie\Errors $errors)
40 {
41 if ($this->key == 1 || $this->key == 2)
42 {
43 $errors[] = $errors->format('The role %name cannot be deleted.', array('name' => $this->record->name));
44 }
45
46 return parent::validate($errors);
47 }
48 }