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::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{NewsKind, Sender, ServiceCtx, Store};
|
||||
|
||||
// LIST/OLIST: show the bulletins of a kind. Public is open; oper is oper-only.
|
||||
pub fn handle(me: &str, from: &Sender, kind: &str, oper_only: bool, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
pub fn handle(me: &str, from: &Sender, kind: NewsKind, oper_only: bool, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
if oper_only && !from.privs.any() {
|
||||
ctx.notice(me, from.uid, "Access denied — oper bulletins are for services operators.");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue