Jump to:

22997 Posts in 11853 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » SOLVED if canEdit return false - also prevent from creating children?

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

Page: 1
Go to End
Author Topic: 342 Views
  • danzzz
    Avatar
    Community Member
    175 Posts

    SOLVED if canEdit return false - also prevent from creating children? Link to this post

    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 ...

    ?

  • danzzz
    Avatar
    Community Member
    175 Posts

    Re: SOLVED if canEdit return false - also prevent from creating children? Link to this post

    function canAddChildren($member = null) {}

    342 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.