From be5ee198129301d84912380ed8d1636ad32f68b3 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Wed, 15 Apr 2020 11:53:38 +0200 Subject: SQL: Split "perm" column into multiple booleans This simplifies several actions and makes permission checks more obvious. This is also yack shaving for another feature I've been planning to add: boardmods should be able to set other users' "board" permission, tagmods for tags, etc. So that partial user bans don't need the full "usermod" permission. --- lib/VNDB/DB/Users.pm | 2 +- lib/VNDB/Util/Auth.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/VNDB') diff --git a/lib/VNDB/DB/Users.pm b/lib/VNDB/DB/Users.pm index 2f7d8e5c..85654180 100644 --- a/lib/VNDB/DB/Users.pm +++ b/lib/VNDB/DB/Users.pm @@ -29,7 +29,7 @@ sub dbUserGet { ); my @select = ( - qw|id username c_votes c_changes c_tags hide_list|, + qw|id username c_votes c_changes c_tags|, VNWeb::DB::sql_user(), # XXX: This duplicates id and username, but updating all the code isn't going to be easy q|extract('epoch' from registered) as registered|, ); diff --git a/lib/VNDB/Util/Auth.pm b/lib/VNDB/Util/Auth.pm index 4394149f..b05c86f9 100644 --- a/lib/VNDB/Util/Auth.pm +++ b/lib/VNDB/Util/Auth.pm @@ -73,7 +73,7 @@ sub authInfo { # a certain action. sub authCan { my(undef, $act) = @_; - auth->perm() & auth->listPerms->{$act} + auth && auth->{user}{"perm_$act"} } -- cgit v1.2.3