1 <?php
 2 
 3 /**
 4  * @package redaxo\mediapool
 5  */
 6 class rex_media_perm extends rex_complex_perm
 7 {
 8     public function hasCategoryPerm($category_id)
 9     {
10         return $this->hasAll() || in_array($category_id, $this->perms);
11     }
12 
13     public function hasMediaPerm()
14     {
15         return $this->hasAll() || count($this->perms) > 0;
16     }
17 
18     public static function getFieldParams()
19     {
20         return [
21             'label' => rex_i18n::msg('mediafolder'),
22             'all_label' => rex_i18n::msg('all_mediafolder'),
23             'select' => new rex_media_category_select(false),
24         ];
25     }
26 }
27