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.

General Questions /

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

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

Permissions CanView() [Solved]


Go to End


2 Posts   1475 Views

Avatar
cumquat

Community Member, 201 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, 201 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