We launched new forums in March 2019—
join us there
.
In a hurry for help with your website?
Get Help Now!
Back to MODX.com
Forums
Docs
Revo Issues
Blog
My Forums
Products
Revo Discussions & Support
Revolution 2.3
Search
Rest server authentication
38 Posts
kinazz
Reply #1,
11 years, 8 months ago
Hi all,
I am developing a rest api following this guide:
http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/developing-rest-servers
How do I implement authentication?
This function returns true, there's no logic in it (core/model/modx/rest/modrestservice.class.php, line 102):
public function checkPermissions() {
return true;
}
Regards,
Alessandro
38 Posts
kinazz
Reply #2,
11 years, 7 months ago
Anyone?
24,544 Posts
BobRay
Reply #3,
11 years, 7 months ago
That's usually done like this:
return $modx->user->hasPermission('some_permission');
It assumes that the user is logged in in the front end and has a Context Access ACL entry for the front-end Context that gives them the specified permission.
Did I help you?
Buy me a beer
Get my Book:
MODX:The Official Guide
MODX info for everyone:
http://bobsguides.com/modx.html
My MODX Extras
Bob's Guides is now hosted at
A2 MODX Hosting
38 Posts
kinazz
Reply #4,
11 years, 7 months ago
Thanks a lot!
I'll give it a try