diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-10-24 16:12:34 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-10-24 16:12:34 -0400 |
commit | 22cb0c568736aa53bcde64152d25ba44a1aad4c7 (patch) | |
tree | 7ec718c36cafb79c8fe03f0441a8eaa36454c876 /actions | |
parent | 371cb4a5548409305ea1d06d703dba475ca08dfe (diff) |
add is_readonly() to api.php
darcs-hash:20081024201234-84dde-06d2c147ec967cb8123ee0639a76f00a5f44e5c5.gz
Diffstat (limited to 'actions')
-rw-r--r-- | actions/api.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actions/api.php b/actions/api.php index 77e20073d..ea4553543 100644 --- a/actions/api.php +++ b/actions/api.php @@ -160,4 +160,25 @@ class ApiAction extends Action { } } + function is_readonly() { + # NOTE: before handle(), can't use $this->arg + $apiaction = $_REQUEST['apiaction']; + $method = $_REQUEST['method']; + list($cmdtext, $fmt) = explode('.', $method); + + # FIXME: probably need a table here, instead of this switch + + switch ($apiaction) { + case 'statuses': + switch ($cmdtext) { + case 'update': + case 'destroy': + return false; + default: + return true; + } + default: + return false; + } + } } |