2010-10-29 13:19:51 +00:00
|
|
|
<?php
|
2010-12-22 19:49:56 +00:00
|
|
|
/**
|
|
|
|
* Implementation of user and group access object
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS_Core
|
2010-12-22 19:49:56 +00:00
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe,
|
|
|
|
* 2010 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2010-10-29 13:19:51 +00:00
|
|
|
|
2010-11-23 08:13:17 +00:00
|
|
|
/**
|
|
|
|
* Class to represent a user access right.
|
|
|
|
* This class cannot be used to modify access rights.
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS_Core
|
2010-11-23 08:13:17 +00:00
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
2010-12-22 19:49:56 +00:00
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe,
|
|
|
|
* 2010 Uwe Steinmann
|
2010-11-23 08:13:17 +00:00
|
|
|
* @version Release: @package_version@
|
2010-10-29 13:19:51 +00:00
|
|
|
*/
|
2013-02-14 11:10:53 +00:00
|
|
|
class SeedDMS_Core_UserAccess { /* {{{ */
|
2010-11-18 10:28:45 +00:00
|
|
|
var $_user;
|
2010-10-29 13:19:51 +00:00
|
|
|
var $_mode;
|
|
|
|
|
2016-03-22 14:08:36 +00:00
|
|
|
function __construct($user, $mode) {
|
2010-11-18 10:28:45 +00:00
|
|
|
$this->_user = $user;
|
2010-10-29 13:19:51 +00:00
|
|
|
$this->_mode = $mode;
|
|
|
|
}
|
|
|
|
|
2010-11-18 10:28:45 +00:00
|
|
|
function getUserID() { return $this->_user->getID(); }
|
2010-10-29 13:19:51 +00:00
|
|
|
|
|
|
|
function getMode() { return $this->_mode; }
|
|
|
|
|
2011-03-23 13:29:07 +00:00
|
|
|
function isAdmin() {
|
2013-02-14 11:10:53 +00:00
|
|
|
return ($this->_mode == SeedDMS_Core_User::role_admin);
|
2011-03-23 13:29:07 +00:00
|
|
|
}
|
|
|
|
|
2010-11-18 10:28:45 +00:00
|
|
|
function getUser() {
|
2010-10-29 13:19:51 +00:00
|
|
|
return $this->_user;
|
|
|
|
}
|
2010-11-23 08:13:17 +00:00
|
|
|
} /* }}} */
|
2010-10-29 13:19:51 +00:00
|
|
|
|
|
|
|
|
2010-11-23 08:13:17 +00:00
|
|
|
/**
|
|
|
|
* Class to represent a group access right.
|
|
|
|
* This class cannot be used to modify access rights.
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS_Core
|
2010-11-23 08:13:17 +00:00
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, 2010 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2013-02-14 11:10:53 +00:00
|
|
|
class SeedDMS_Core_GroupAccess { /* {{{ */
|
2010-11-18 10:28:45 +00:00
|
|
|
var $_group;
|
2010-10-29 13:19:51 +00:00
|
|
|
var $_mode;
|
|
|
|
|
2016-03-22 14:08:36 +00:00
|
|
|
function __construct($group, $mode) {
|
2010-11-18 10:28:45 +00:00
|
|
|
$this->_group = $group;
|
2010-10-29 13:19:51 +00:00
|
|
|
$this->_mode = $mode;
|
|
|
|
}
|
|
|
|
|
2010-11-18 10:28:45 +00:00
|
|
|
function getGroupID() { return $this->_group->getID(); }
|
2010-10-29 13:19:51 +00:00
|
|
|
|
|
|
|
function getMode() { return $this->_mode; }
|
|
|
|
|
2010-11-18 10:28:45 +00:00
|
|
|
function getGroup() {
|
2010-10-29 13:19:51 +00:00
|
|
|
return $this->_group;
|
|
|
|
}
|
2010-11-23 08:13:17 +00:00
|
|
|
} /* }}} */
|
2010-10-29 13:19:51 +00:00
|
|
|
?>
|