We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 22cb0c56 authored by Evan Prodromou's avatar Evan Prodromou

add is_readonly() to api.php

darcs-hash:20081024201234-84dde-06d2c147ec967cb8123ee0639a76f00a5f44e5c5.gz
parent 371cb4a5
......@@ -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;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment