mirror of
https://github.com/matrix-construct/construct
synced 2024-06-10 05:58:56 +02:00
modules/admin: Apply REQUIRES_OPER method flag; simplify.
This commit is contained in:
parent
605245953a
commit
3dafa47ac3
|
@ -37,7 +37,7 @@ ircd::m::admin::post_method
|
||||||
{
|
{
|
||||||
deactivate_resource, "POST", handle_post,
|
deactivate_resource, "POST", handle_post,
|
||||||
{
|
{
|
||||||
post_method.REQUIRES_AUTH
|
post_method.REQUIRES_OPER
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,12 +56,6 @@ ircd::m::admin::handle_post(client &client,
|
||||||
url::decode(user_id, request.parv[0])
|
url::decode(user_id, request.parv[0])
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!is_oper(request.user_id))
|
|
||||||
throw m::ACCESS_DENIED
|
|
||||||
{
|
|
||||||
"You are not an operator."
|
|
||||||
};
|
|
||||||
|
|
||||||
m::user user
|
m::user user
|
||||||
{
|
{
|
||||||
user_id
|
user_id
|
||||||
|
|
|
@ -38,7 +38,7 @@ ircd::m::admin::get_method
|
||||||
{
|
{
|
||||||
users_resource, "GET", handle_get,
|
users_resource, "GET", handle_get,
|
||||||
{
|
{
|
||||||
get_method.REQUIRES_AUTH
|
get_method.REQUIRES_OPER
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue