Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » CanEdit blocking popup

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 773 Views
  • Room9
    Avatar
    Community Member
    19 Posts

    CanEdit blocking popup Link to this post

    Hi,

    I have ModelAdmin with several CMS tabs to view data for my DataObject. It's read-only so CanEdit is set to false.

    When I use DOM to view associated records I can't get the details popup to display in this mode, when I switch CanEdit to true the popup shows. When I leave CanEdit as false and use ComplexTableField instead I do get the read-only popup. But the DOM looks so much nicer!

    I tried using $dom->setPermissions(array('view')); but it makes no difference.

    How can I get the Popup to show in read-only mode?

    Thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: CanEdit blocking popup Link to this post

    Hmm.. I'm not able to replicate that. When I use:

    $myDOM->setPermissions(array('view'));

    I get a readonly form. This is a regular DOM? Not a FileDOM or anything? Shouldn't make a difference anyway, but I was testing with a regular DOM..

  • Room9
    Avatar
    Community Member
    19 Posts

    Re: CanEdit blocking popup Link to this post

    Hi UncleCheese!

    I've created an example here: http://www.pastie.org/1622553. You should be able to add this to a SS install and check in the CMS.

    If I comment out the 'public function canEdit() {return false;}' I get the popup, otherwise I don't. Would love to have a readonly popup.

    Cheers!

    773 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.