infoserv: type the news kind as an enum at the store boundary
All checks were successful
CI / check (push) Successful in 3m53s
All checks were successful
CI / check (push) Successful in 3m53s
This commit is contained in:
parent
ee95225eaf
commit
7a5f1502a4
11 changed files with 49 additions and 31 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use echo_api::{Priv, Sender, ServiceCtx, Store};
|
||||
use echo_api::{NewsKind, Priv, Sender, ServiceCtx, Store};
|
||||
|
||||
// POST/OPOST <message>: add a bulletin (public or oper). Admin only.
|
||||
pub fn handle(me: &str, from: &Sender, kind: &str, rest: &[&str], ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
pub fn handle(me: &str, from: &Sender, kind: NewsKind, rest: &[&str], ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
if !from.privs.has(Priv::Admin) {
|
||||
ctx.notice(me, from.uid, "Access denied — posting bulletins is for services operators.");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue