Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

CanEdit blocking popup


Go to End


3 Posts   1241 Views

Avatar
Room9

Community Member, 19 Posts

1 March 2011 at 3:26pm

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!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 March 2011 at 3:50pm

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..

Avatar
Room9

Community Member, 19 Posts

2 March 2011 at 11:43am

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!