summaryrefslogtreecommitdiff
path: root/actions/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/api.php')
-rw-r--r--actions/api.php21
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;
+ }
+ }
}