-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Access denied on Member model #55
Comments
First thing I can think of is that the Member you use to access the API doesn't the right to read the Member record you are trying to access, maybe? Since Member has it's default set of canView etc... You don't have any other extension on the Member object? |
The user I'm using is an admin so I don't think it's that. I do have an extension. Do I need to add that instead of Member? |
For the extension I was just wondering if there might be code there that affects it... maybe? can you post the code? |
Im having a similar issue, I can't really see any support which makes me think the answers easy and im just confused. I would like to be able to create a new member by posting to a url: "http://mysite.local/api/Member" with data like : {"FirstName":"test1"}. When I try the above I get a "Token invalid" response. Heres my config.yml
|
The "Token invalid" error is because you are using an This means you need to pass a The token itself comes from the DataObject who has the Or you could just disable it for test purposes by setting |
I apologize I was a bit vague. Its for registration. So for a new user to create a profile in order to login. At this point in the journey he (the user) would not have a token but would require one only after registering |
@MarkyParkyJozi I see... |
THANKS @colymba it works if I place it in my yml as:
But thats a bit dangerous so i tried extending my member so that only the 'Member' model would have the policy:
and my config.yml:
And then my post would now be to : http://mysite.local/api/MyMemberExtension but its the same 'Token invalid' message Im still pretty new to silverstripe so maybe Im missing some fundamentals? Surely this pattern or something similar has been done before |
@MarkyParkyJozi |
Brilliant!, knowing what wont work is half the battle. @colymba can you direct me to any documentation that would allow me to use the RESTfulAPI and have the desired pattern of allowing registration |
@MarkyParkyJozi this is now going off topic for this issue.... bets thing is for you to create a new issue and we can continue there.... |
I'm trying to access the Member model in the API but am just getting API access denied. All other models are working perfectly fine. See config below:
The text was updated successfully, but these errors were encountered: