FOF30\Controller\DataController::getACLForApplySave PHP 메소드

getACLForApplySave() 보호된 메소드

Gets the applicable ACL privilege for the apply and save tasks. The value returned is: - @add if the record's ID is empty / record doesn't exist - True if the ACL privilege of the edit task (@edit) is allowed - @editown if the owner of the record (field user_id, userid or user) is the same as the logged in user - False if the record is not owned by the logged in user and the user doesn't have the @edit privilege
protected getACLForApplySave ( ) : boolean | string
리턴 boolean | string
    protected function getACLForApplySave()
    {
        $model = $this->getModel();
        if (!$model->getId()) {
            $this->getIDsFromRequest($model, true);
        }
        $id = $model->getId();
        if (!$id) {
            return '@add';
        }
        if ($this->checkACL('@edit')) {
            return true;
        }
        $user = $this->container->platform->getUser();
        $uid = 0;
        if ($model->hasField('user_id')) {
            $uid = $model->getFieldValue('user_id');
        } elseif ($model->hasField('userid')) {
            $uid = $model->getFieldValue('userid');
        } elseif ($model->hasField('user')) {
            $uid = $model->getFieldValue('user');
        }
        if (!empty($uid) && !$user->guest && $user->id == $uid) {
            return '@editown';
        }
        return false;
    }