src/Control/Controller.php
public function can($perm, $member = null)
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }
        if (is_array($perm)) {
            $perm = array_map(array($this, 'can'), $perm, array_fill(0, count($perm), $member));
            return min($perm);
        }
        if ($this->hasMethod($methodName = 'can' . $perm)) {
            return $this->$methodName($member);
        } else {
            return true;
        }
    }
public function can($perm, $member = null)
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }
        if (is_array($perm)) {
            $perm = array_map(array($this, 'can'), $perm, array_fill(0, count($perm), $member));
            return min($perm);
        }
        if ($this->hasMethod($methodName = 'can' . $perm)) {
            return $this->$methodName($member);
        } else {
            return true;
        }
    }
public function can ( $ perm , $ member = null ) { if ( ! $ member ) { $ member = Security :: getCurrentUser ( ) ; } if ( is_array ( $ perm ) ) { $ perm = array_map ( array ( $ this , 'can' ) , $ perm , array_fill ( 0 , count ( $ perm ) , $ member ) ) ; return min ( $ perm ) ; } if ( $ this -> hasMethod ( $ methodName = 'can' . $ perm ) ) { return $ this -> $ methodName ( $ member ) ; } else { return true ; } }
Returns true if the member is allowed to do the given action. Defaults to the currently logged
in user.

@param string $perm
@param null|member $member

@return bool
Returns true if the member is allowed to do the given action . Defaults to the currently logged in user .