From ecdbcbbbba954ca3443811b2f7ff1ef6e2f2c903 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 6 Dec 2024 11:03:39 -0500 Subject: [PATCH] Add GROUP creation permission to server_permission --- db/newsgroup.sql | 3 ++- lib/nntp/tiny/user.py | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/db/newsgroup.sql b/db/newsgroup.sql index e26e277..38a0d88 100644 --- a/db/newsgroup.sql +++ b/db/newsgroup.sql @@ -43,7 +43,8 @@ create table server_permission ( insert into server_permission values (1, 'READ'), (2, 'POST'), - (3, 'KILL'); + (3, 'KILL'), + (4, 'GROUP'); create table server_user ( id INTEGER PRIMARY KEY NOT NULL, diff --git a/lib/nntp/tiny/user.py b/lib/nntp/tiny/user.py index e03f206..c5adefe 100644 --- a/lib/nntp/tiny/user.py +++ b/lib/nntp/tiny/user.py @@ -4,16 +4,18 @@ from nntp.tiny.db import Database, DatabaseTable from nntp.tiny.passwd import compare class UserPermission(enum.Flag): - NONE = 0 - READ = 1 - POST = enum.auto() - KILL = enum.auto() + NONE = 0 + READ = 1 + POST = enum.auto() + KILL = enum.auto() + GROUP = enum.auto() def __str__(self): return { 1: 'READ', 2: 'POST', - 3: 'KILL' + 3: 'KILL', + 4: 'GROUP' }[self.value] class User(DatabaseTable):