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

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


Go to End


2 Posts   1490 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) {}