models/Post.php
public function filterFields($fields, $context = null)
    {
        if (!isset($fields->published, $fields->published_at)) {
            return;
        }

        $user = BackendAuth::getUser();

        if (!$user->hasAnyAccess(['rainlab.blog.access_publish'])) {
            $fields->published->hidden = true;
            $fields->published_at->hidden = true;
        }
        else {
            $fields->published->hidden = false;
            $fields->published_at->hidden = false;
        }
    }
public function filterFields($fields, $context = null)
    {
        if (!isset($fields->published, $fields->published_at)) {
            return;
        }

        $user = BackendAuth::getUser();

        if (!$user->hasAnyAccess(['rainlab.blog.access_publish'])) {
            $fields->published->hidden = true;
            $fields->published_at->hidden = true;
        }
        else {
            $fields->published->hidden = false;
            $fields->published_at->hidden = false;
        }
    }
public function filterFields ( $ fields , $ context = null ) { if ( ! isset ( $ fields -> published , $ fields -> published_at ) ) { return ; } $ user = BackendAuth :: getUser ( ) ; if ( ! $ user -> hasAnyAccess ( [ 'rainlab.blog.access_publish' ] ) ) { $ fields -> published -> hidden = true ; $ fields -> published_at -> hidden = true ; } else { $ fields -> published -> hidden = false ; $ fields -> published_at -> hidden = false ; } }
Limit visibility of the published-button

@param       $fields
@param  null $context
@return void
Limit visibility of the published - button