From 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 22 Jan 2015 09:14:12 +0100 Subject: Apply namespaces to class inheritances (pt1) --- framework/Security/IUser.php | 63 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 framework/Security/IUser.php (limited to 'framework/Security/IUser.php') diff --git a/framework/Security/IUser.php b/framework/Security/IUser.php new file mode 100644 index 00000000..fd7db297 --- /dev/null +++ b/framework/Security/IUser.php @@ -0,0 +1,63 @@ + + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package Prado\Security + */ + +namespace Prado\Security; + +/** + * IUser interface. + * + * This interface must be implemented by user objects. + * + * @author Qiang Xue + * @package Prado\Security + * @since 3.0 + */ +interface IUser +{ + /** + * @return string username + */ + public function getName(); + /** + * @param string username + */ + public function setName($value); + /** + * @return boolean if the user is a guest + */ + public function getIsGuest(); + /** + * @param boolean if the user is a guest + */ + public function setIsGuest($value); + /** + * @return array list of roles that the user is of + */ + public function getRoles(); + /** + * @return array|string list of roles that the user is of. If it is a string, roles are assumed by separated by comma + */ + public function setRoles($value); + /** + * @param string role to be tested + * @return boolean whether the user is of this role + */ + public function isInRole($role); + /** + * @return string user data that is serialized and will be stored in session + */ + public function saveToString(); + /** + * @param string user data that is serialized and restored from session + * @return IUser the user object + */ + public function loadFromString($string); +} \ No newline at end of file -- cgit v1.2.3