src/Model/Comment.php
protected function actionLink($action, $member = null)
    {
        if (!$member) {
            $member = Member::currentUser();
        }
        if (!$member) {
            return false;
        }

        /**
         * @todo: How do we handle "DataObject" instances that don't have a Link to reject/spam/delete?? This may
         * we have to make CMS a hard dependency instead.
         */
        // if (!$this->Parent()->hasMethod('Link')) {
        //     return false;
        // }

        $url = Controller::join_links(
            Director::baseURL(),
            'comments',
            $action,
            $this->ID
        );

        // Limit access for this user
        $token = $this->getSecurityToken();
        return $token->addToUrl($url, $member);
    }
protected function actionLink($action, $member = null)
    {
        if (!$member) {
            $member = Member::currentUser();
        }
        if (!$member) {
            return false;
        }

        /**
         * @todo: How do we handle "DataObject" instances that don't have a Link to reject/spam/delete?? This may
         * we have to make CMS a hard dependency instead.
         */
        // if (!$this->Parent()->hasMethod('Link')) {
        //     return false;
        // }

        $url = Controller::join_links(
            Director::baseURL(),
            'comments',
            $action,
            $this->ID
        );

        // Limit access for this user
        $token = $this->getSecurityToken();
        return $token->addToUrl($url, $member);
    }
protected function actionLink ( $ action , $ member = null ) { if ( ! $ member ) { $ member = Member :: currentUser ( ) ; } if ( ! $ member ) { return false ; } /**
         * @todo: How do we handle "DataObject" instances that don't have a Link to reject/spam/delete?? This may
         * we have to make CMS a hard dependency instead.
         */ // if (!$this->Parent()->hasMethod('Link')) { //     return false; // } $ url = Controller :: join_links ( Director :: baseURL ( ) , 'comments' , $ action , $ this -> ID ) ; // Limit access for this user $ token = $ this -> getSecurityToken ( ) ; return $ token -> addToUrl ( $ url , $ member ) ; }
Generate a secure admin-action link authorised for the specified member

@param string $action An action on CommentingController to link to
@param Member $member The member authorised to invoke this action

@return string
Generate a secure admin - action link authorised for the specified member