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

Permissions on DataObject for RESTful server $api_access


Go to End


2 Posts   1129 Views

Avatar
woodb2

Community Member, 48 Posts

18 May 2012 at 3:06am

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

Avatar
woodb2

Community Member, 48 Posts

18 May 2012 at 11:19am

Just needed to add

function canView(){
return true;
}