protected $_migrateTranslatable = false;
protected $_can = null;
+ protected $_canWrite = null;
protected $_auth = true;
/**
'preview' => $this->_preview, 'column_type' => $this->_columnType, 'column_move_after' => $this->_columnMoveAfter, 'column_format' => $this->_columnFormat,
'default' => '', 'cast' => $this->_cast, 'column_view_namespace' => $this->_columnViewNamespace, 'searchLogic' => $this->_searchLogic,
'allow_null' => true,
- 'can' => $this->_can, 'auth' => $this->_auth,
+ 'can' => $this->_can, 'can_write' => $this->_canWrite, 'auth' => $this->_auth,
'database_unique' => $this->_databaseUnique, 'database_index' => $this->_databaseIndex,
'fake' => false, 'store_in' => 'extras', 'attributes' => []];
}
$this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');
}
}
+
+ if (null !== $this->getAttribute('can_write', null)) {
+ if (!can($this->getAttribute('can_write'))) {
+ $this->setAttribute('type', 'static');
+ $this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');
+ }
+ }
}
/**