1 <?php
2
3 /**
4 * Interface for user roles.
5 *
6 * @author gharlan
7 *
8 * @package redaxo\core\login
9 */
10 interface rex_user_role_interface
11 {
12 /**
13 * Returns if the role has the given permission.
14 *
15 * @param string $perm Perm key
16 */
17 public function hasPerm($perm);
18
19 /**
20 * Returns the complex perm.
21 *
22 * @param rex_user $user User instance
23 * @param string $key Complex perm key
24 *
25 * @return rex_complex_perm Complex perm
26 */
27 public function getComplexPerm(rex_user $user, $key);
28
29 /**
30 * Returns the role for the given ID.
31 *
32 * @param string $id IDs comma seperated
33 *
34 * @return static Role instance
35 */
36 public static function get($id);
37 }
38