public function getDefaultAction()
    {
        // Determine the appliccable action
        if ( ! $this->default_action) {
            return null;
        }

        $actions = $this->default_action;

        if ( ! is_array($actions)) {
            $actions = [
                new ModelActionReferenceData([
                    'strategy' => $actions,
                ]),
            ];
        }

        $core = $this->getCore();


        foreach ($actions as $action) {

            $permissions = $action->permissions();

            if (    ! count($permissions)
                ||  $core->auth()->user()->isAdmin()
                ||  $core->auth()->user()->can($permissions)
            ) {
                return $action;
            }
        }

        return null;
    }
public function getDefaultAction()
    {
        // Determine the appliccable action
        if ( ! $this->default_action) {
            return null;
        }

        $actions = $this->default_action;

        if ( ! is_array($actions)) {
            $actions = [
                new ModelActionReferenceData([
                    'strategy' => $actions,
                ]),
            ];
        }

        $core = $this->getCore();


        foreach ($actions as $action) {

            $permissions = $action->permissions();

            if (    ! count($permissions)
                ||  $core->auth()->user()->isAdmin()
                ||  $core->auth()->user()->can($permissions)
            ) {
                return $action;
            }
        }

        return null;
    }
public function getDefaultAction ( ) { // Determine the appliccable action if ( ! $ this -> default_action ) { return null ; } $ actions = $ this -> default_action ; if ( ! is_array ( $ actions ) ) { $ actions = [ new ModelActionReferenceData ( [ 'strategy' => $ actions , ] ) , ] ; } $ core = $ this -> getCore ( ) ; foreach ( $ actions as $ action ) { $ permissions = $ action -> permissions ( ) ; if ( ! count ( $ permissions ) || $ core -> auth ( ) -> user ( ) -> isAdmin ( ) || $ core -> auth ( ) -> user ( ) -> can ( $ permissions ) ) { return $ action ; } } return null ; }
Returns the default action for list rows.

@return ModelActionReferenceDataInterface|null
Returns the default action for list rows .