Jump to:

22999 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Permissions on DataObject for RESTful server $api_access

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: 597 Views
  • woodb2
    Avatar
    Community Member
    48 Posts

    Permissions on DataObject for RESTful server $api_access Link to this post

    I have a DataObject "Enhancement"

    Another server on our internal network needs to be able to pull data from Enhancement.

    I've set $api_access with:

    static $api_access = array(
          'view' => array(
             'Title',
             'userid',
             'Description',
             'Ecallnumber',
             'feedback'));

    If I'm logged in I can go to my URL http://servername/enhancement/api/V1/Enhancement and see the data.

    If I log out of the site I only get <DataObjectSet totalSize="48">
    </DataObjectSet>

    How can I allow users who aren't logged access to view the data?

    Thanks,
    Brian

  • woodb2
    Avatar
    Community Member
    48 Posts

    Re: Permissions on DataObject for RESTful server $api_access Link to this post

    Just needed to add

    function canView(){
    return true;
    }

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