[Struts4php-user] noch eine kleine =?ISO-8859-15?Q?=E4nderung?=
Brought to you by:
brainguide
|
From: Ralph B. <ra...@da...> - 2005-03-13 13:47:32
|
actionbanana.php:
function process( &$request, $role) {
// find the ActionMapping for this request
$this->setRole($role);
$actionMapping = $this->processMapping( $request->getAttribute( PATH
) );
// check permission
$allowedroles = $actionMapping->getRoles();
$role = (!is_array($role)) ? array($role) : $role;
$result = array_intersect($role, $allowedroles);
if (empty($result)) {
$forward = $actionMapping->findForward( NOTALLOWED );
$request->setAttribute( PATH, $forward->getPath() );
$actionMapping = $this->processMapping( $request->getAttribute(
PATH ) );
}
// check if a direct path to another site or file is given
$actionForward = $this->processForward( $actionMapping, $request );
if ( !$actionForward ) {
.
.
.
dadurch kann ein nutzer auch mehrere rollen haben, dann als array
übergeben, bei einer rolle ist auch ein string möglich
ralph
|