php - SilverStripe gridField Entries not visible for normal backend user -


i have 2 user groups administrator , inhaltsautoren

my landingpage has tab teaser gridfield. normal user can not see entries , dont know why?

i cant find setting permissions inhaltsautoren. has idea why there no entries in gridfield?

teaser.php

<?php   class teaser extends dataobject {  private static $db = array (     'title' => 'varchar',     'description' => 'htmltext' );  private static $has_one = array (     'photo' => 'image',     'link' => 'link' );  private static $many_many = array(     'tags' => 'tag' );  private static $summary_fields = array (     'gridthumbnail' => '',     'title' => 'titel',     'description' => 'beschreibung' );  public function getgridthumbnail() {     if($this->photo()->exists()) {         return $this->photo()->setwidth(100);     }      return "(no image)"; }  public function getcmsfields() {     $fields = fieldlist::create(         textfield::create('title'),         $tags = tagfield::create('tags','tags',tag::get(),$this->tags()),         htmleditorfield::create('description', 'beschreibung'),         linkfield::create('linkid', 'weiterleitung'),         $uploader = uploadfield::create('photo')     );      $tags->setshouldlazyload(true); // tags should lazy loaded     $tags->setcancreate(true);      // new tag dataobjects can created      $uploader->setfoldername('teaser');     $uploader->getvalidator()->setallowedextensions(array('png','jpeg','jpg'));      return $fields; } } 

and ladingpage.php

$fields->addfieldtotab('root.teaser', $gridfield = gridfield::create(     'teasers',     'landing page teaser',     $this->teasers(),     gridfieldconfig_recordeditor::create() ));   $gridfield->getconfig()->getcomponentbytype("gridfielddatacolumns")->setfieldcasting(array("description"=>"htmltext->bigsummary")); 

use canview() on dataobject , check inside function if user allowed see object or not.

  public function canview($member = null) {     return permission::check('admin', 'any');   } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -