I have a DataObject that needs specific permisions for a certain group. I'd like that group to be able to vew the object but not edit or create.
I've set the following permissions on the DataObject itself
function canView($member = null) {
if(!$member) $member = Member::currentUser();
return $member->inGroups(array('administrators', "print-ads"));
}
function canEdit($member = false) {
if(!$member) $member = Member::currentUser();
return $member->inGroup('administrators');
}
function canCreate($member = false) {
if(!$member) $member = Member::currentUser();
return $member->inGroup('administrators');
}
When logged is as a user in print-ads group I get the ModelAdmin for the object. The gridfield displays the object and the add button. The odd thing is the print-ad group can add a DataObject with the button (which it shouldn't) and it is unable to click on individual dataobjects in the gridfield to view teh details.