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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

SOLVED if canEdit return false - also prevent from creating children?


Go to End


2 Posts   1013 Views

Avatar
danzzz

Community Member, 175 Posts

29 July 2012 at 8:45am

I have a pagetype (NewsCategory extends Page) with this canEdit function:

function canEdit($Member = null){
		if(permission::check('PAGETYPE_NEWSCATEGORY_EDIT')){
			return true;
		} else {
			return false;
		}
	}

In my understanding this should prevent a user (not having the correct perms) to edit pages with this pagetype,
which is correct. But in my case it's also preventing users to create children under this pagetype. Why?

This pagetype should be a holder for NewsArticles. User should can create NewsArticles but should not be able
to edit NewsCategory ...

?

Avatar
danzzz

Community Member, 175 Posts

29 July 2012 at 11:39am

function canAddChildren($member = null) {}