public function isAuthorized($user = null) {
		$result = false;
		if (empty($this->prefixes) || !is_array($this->prefixes)) {
			return $result;
		}
		$rolePrefix = (string)$this->_objUserInfo->getUserField('prefix', $user);
		if (!empty($rolePrefix)) {
			if (!in_array($rolePrefix, $this->prefixes)) {
				return $result;
			}
			$prefixes = [$rolePrefix];
		} else {
			$prefixes = $this->prefixes;
		}

		$action = $this->_controller->request->param('action');
		foreach ($prefixes as $prefix) {
			if (mb_stripos($action, $prefix . '_') === 0) {
				$result |= true;
			} else {
				$result |= false;
			}
		}
		if (empty($rolePrefix)) {
			$result = !$result;
		}

		return (bool)$result;
	}
public function isAuthorized($user = null) {
		$result = false;
		if (empty($this->prefixes) || !is_array($this->prefixes)) {
			return $result;
		}
		$rolePrefix = (string)$this->_objUserInfo->getUserField('prefix', $user);
		if (!empty($rolePrefix)) {
			if (!in_array($rolePrefix, $this->prefixes)) {
				return $result;
			}
			$prefixes = [$rolePrefix];
		} else {
			$prefixes = $this->prefixes;
		}

		$action = $this->_controller->request->param('action');
		foreach ($prefixes as $prefix) {
			if (mb_stripos($action, $prefix . '_') === 0) {
				$result |= true;
			} else {
				$result |= false;
			}
		}
		if (empty($rolePrefix)) {
			$result = !$result;
		}

		return (bool)$result;
	}
public function isAuthorized ( $ user = null ) { $ result = false ; if ( empty ( $ this -> prefixes ) || ! is_array ( $ this -> prefixes ) ) { return $ result ; } $ rolePrefix = ( string ) $ this -> _objUserInfo -> getUserField ( 'prefix' , $ user ) ; if ( ! empty ( $ rolePrefix ) ) { if ( ! in_array ( $ rolePrefix , $ this -> prefixes ) ) { return $ result ; } $ prefixes = [ $ rolePrefix ] ; } else { $ prefixes = $ this -> prefixes ; } $ action = $ this -> _controller -> request -> param ( 'action' ) ; foreach ( $ prefixes as $ prefix ) { if ( mb_stripos ( $ action , $ prefix . '_' ) === 0 ) { $ result |= true ; } else { $ result |= false ; } } if ( empty ( $ rolePrefix ) ) { $ result = ! $ result ; } return ( bool ) $ result ; }
Checking the requested controller action on the user's access by prefix role

@param array $user Array of information about authenticated user
@return bool True if action is accessible. False otherwise.
Checking the requested controller action on the user s access by prefix role