Jump to:

5516 Posts in 1734 Topics by 1221 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Using RestfulServer with Member DataObjectDecorator

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

Page: 1
Go to End
Author Topic: 209 Views
  • MonkeyBen
    Avatar
    Community Member
    25 Posts

    Using RestfulServer with Member DataObjectDecorator Link to this post

    I have a site I am building that my client has a need to do things via restful server. All is going fine until I have tried to use the restful server to create a new member.

    This line of code https://github.com/silverstripe/silverstripe-restfulserver/blob/master/code/RestfulServer.php#L398

    i.e.

    if(!singleton($className)->canCreate()) return $this->permissionFailure();

    is using the canCreate() function from Member (well, from DataObject) - its is ignoring the canCreate() function in my CustomMember DataObjectDecorator. This means the code is checking to see if the member is admin when it needs no login (thats how my client wants it).

    I've tried using customclass() to replace Member with a custom class and that didnt work either.

    I dont want to touch the core files unless I have to but I can't find a solution.

    Thanks,

    Ben

    P.S. the install is version 2.4 (2.4.7 IIRC).

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