Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Model Admin Permission

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: 1829 Views
  • ttyl
    Avatar
    Community Member
    114 Posts

    Model Admin Permission Link to this post

    I saw there was another thread of this but it didn't answer my question. I want to give a user access to a model admin and nothing else. I can make it happen so they log in and see the model admin page but they can only search, not add. when I check "Full administrative rights" they can see everything and add objects. however, if I uncheck "Full administrative rights" but still check every single other box they can search but not add - so something strange is going on. anybody know how to fix this?

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: Model Admin Permission Link to this post

    override the following functions like this for each dataobject that is being managed...

       function canCreate() {return true;}
       function canEdit() {return true;}
       function canDelete() {return true;}

    Barry

  • ttyl
    Avatar
    Community Member
    114 Posts

    Re: Model Admin Permission Link to this post

    Thanks Barry, that works.

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Model Admin Permission Link to this post

    where do I find the file to add these entries?

  • ttyl
    Avatar
    Community Member
    114 Posts

    Re: Model Admin Permission Link to this post

    add to your dataobject class.

    ie

    class MyDataObject extends DataObject {
    .....
       function canCreate() {return true;}

    }

    ?>

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Model Admin Permission Link to this post

    Thank you, and what file would that be in?

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: Model Admin Permission Link to this post

    It's in the file containing the dataobject class you want to apply the permission to.

    see my reply to your other question for a more comprehensive answer

    Rich

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