public function can($perm, $member = null, $context = array())
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        if ($member && Permission::checkMember($member, "ADMIN")) {
            return true;
        }

        if (is_string($perm) && method_exists($this, 'can' . ucfirst($perm))) {
            $method = 'can' . ucfirst($perm);
            return $this->$method($member);
        }

        $results = $this->extend('can', $member);
        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
        }

        return ($member && Permission::checkMember($member, $perm));
    }
public function can($perm, $member = null, $context = array())
    {
        if (!$member) {
            $member = Security::getCurrentUser();
        }

        if ($member && Permission::checkMember($member, "ADMIN")) {
            return true;
        }

        if (is_string($perm) && method_exists($this, 'can' . ucfirst($perm))) {
            $method = 'can' . ucfirst($perm);
            return $this->$method($member);
        }

        $results = $this->extend('can', $member);
        if ($results && is_array($results)) {
            if (!min($results)) {
                return false;
            }
        }

        return ($member && Permission::checkMember($member, $perm));
    }
public function can ( $ perm , $ member = null , $ context = array ( ) ) { if ( ! $ member ) { $ member = Security :: getCurrentUser ( ) ; } if ( $ member && Permission :: checkMember ( $ member , "ADMIN" ) ) { return true ; } if ( is_string ( $ perm ) && method_exists ( $ this , 'can' . ucfirst ( $ perm ) ) ) { $ method = 'can' . ucfirst ( $ perm ) ; return $ this -> $ method ( $ member ) ; } $ results = $ this -> extend ( 'can' , $ member ) ; if ( $ results && is_array ( $ results ) ) { if ( ! min ( $ results ) ) { return false ; } } return ( $ member && Permission :: checkMember ( $ member , $ perm ) ) ; }
This function should return true if the current user can execute this action. It can be overloaded to customise
the security model for an application.

Slightly altered from parent behaviour in {@link DataObject->can()}:
- Checks for existence of a method named "can<$perm>()" on the object
- Calls decorators and only returns for FALSE "vetoes"
- Falls back to {@link Permission::check()}
- Does NOT check for many-many relations named "Can<$perm>"

@uses DataObjectDecorator->can()

@param string $perm The permission to be checked, such as 'View'
@param Member $member The member whose permissions need checking. Defaults to the currently logged in user.
@param array $context Context argument for canCreate()
@return bool True if the the member is allowed to do the given action
This function should return true if the current user can execute this action . It can be overloaded to customise the security model for an application .