mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
add method check_access()
just like in SeedDMS_View_Common
This commit is contained in:
parent
1c08d83704
commit
7362bf192b
|
@ -246,4 +246,25 @@ class SeedDMS_Controller_Common {
|
|||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Check if the access on the contoller with given name or the current
|
||||
* controller itself may be accessed.
|
||||
*
|
||||
* The function requires the parameter 'accessobject' to be available in the
|
||||
* controller, because it calls SeedDMS_AccessOperation::check_controller_access()
|
||||
* to check access rights. If the the optional $name is not set the
|
||||
* current controller is used.
|
||||
*
|
||||
* @param string|array $name name of controller or list of controller names
|
||||
* @return boolean true if access is allowed otherwise false
|
||||
*/
|
||||
protected function check_access($name='') { /* {{{ */
|
||||
if(!$name)
|
||||
$name = $this;
|
||||
if(!isset($this->params['accessobject']))
|
||||
return false;
|
||||
$access = $this->params['accessobject']->check_controller_access($name);
|
||||
return $access;
|
||||
} /* }}} */
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user