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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Permissions CanView() [Solved]


Reply


2 Posts   869 Views

Avatar
cumquat

Community Member, 198 Posts

28 June 2012 at 1:08am

Edited: 28/06/2012 1:08am

Hi there,

Been a while since i have been on but have now started the road of learning the nuances of SS3 and i have come across my first lack of knowledge, im trying to give a use access to the dataobject 'Job' via Model Admin nothing major but when I try to use the good ole

public function canView() {
return true;
   }


i get this error notice

[Strict Notice] Declaration of Job::canView() should be compatible with that of DataObject::canView()

I have no idea what this means and i cant find any information to tell me what im doing wrong.

Any help or pointers please.

Mick

Avatar
cumquat

Community Member, 198 Posts

28 June 2012 at 1:25am

Edited: 28/06/2012 1:25am

Ok isn't that always the way, you spend hours looking for it, cant find it, post it, then just happen to open up someone else's code that has it....

so what i needed was

public function canView($member = null) {
return true;
   }

cheers

Mick