diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-05 19:45:15 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-05 19:45:15 -0700 |
commit | 481ef823dd04daff736b5a98472322e28bd4e756 (patch) | |
tree | 0e15aebc09bf32dbf5ed6c0b5b1086cf5af877a2 /modules/rest/helpers/rest.php | |
parent | 110350776d5bda3b8535f0329ea69b914daa8019 (diff) |
Add an advanced setting to allow developers to allow guest access to
REST entities.
Diffstat (limited to 'modules/rest/helpers/rest.php')
-rw-r--r-- | modules/rest/helpers/rest.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php index 49999520..72927c71 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.php @@ -39,7 +39,12 @@ class rest_Core { static function set_active_user($access_key) { if (empty($access_key)) { - throw new Rest_Exception("Forbidden", 403); + if (module::get_var("rest", "allow_guest_access")) { + identity::set_active_user(identity::guest()); + return; + } else { + throw new Rest_Exception("Forbidden", 403); + } } $key = ORM::factory("user_access_key") |