PrincipalFactory.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
13 /**
14  * PrincipalFactory implementations are used to retrieve User and
15  * Role instances.
16  *
17  * @author ingo herwig <ingo@wemove.com>
18  */
19 interface PrincipalFactory {
20 
21  /**
22  * Get a User instance by login.
23  * @param $login The user's login
24  * @param $useTempPermission Boolean whether to set a temporary permission
25  * for reading or not (uselfull in the login process, where no authenticated
26  * user exists yet) (optional, default: false)
27  * @return User instance
28  */
29  public function getUser($login, $useTempPermission=false);
30 
31  /**
32  * Get the Role instances associated with the given User instance.
33  * @param $user The User instance
34  * @param $useTempPermission Boolean whether to set a temporary permission
35  * for reading or not (uselfull in the login process, where no authenticated
36  * user exists yet) (optional, default: false)
37  * @return Array of Role instances
38  */
39  public function getUserRoles(User $user, $useTempPermission=false);
40 
41  /**
42  * Get a Role instance by name.
43  * @param $name The role's name
44  * @param $useTempPermission Boolean whether to set a temporary permission
45  * for reading or not (uselfull in the login process, where no authenticated
46  * user exists yet) (optional, default: false)
47  * @return Role instance
48  */
49  public function getRole($name, $useTempPermission=false);
50 }
51 ?>
getRole($name, $useTempPermission=false)
Get a Role instance by name.
getUser($login, $useTempPermission=false)
Get a User instance by login.
getUserRoles(User $user, $useTempPermission=false)
Get the Role instances associated with the given User instance.
PrincipalFactory implementations are used to retrieve User and Role instances.
User is the interface for users.
Definition: User.php:18