summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-15 11:53:38 +0200
committerYorhel <git@yorhel.nl>2020-04-15 11:53:40 +0200
commitbe5ee198129301d84912380ed8d1636ad32f68b3 (patch)
treed02840ee97c05818556f886e69bcc5783b44c229 /lib/VNDB
parent5a3a446b0530632942c577edbf10e9c7c2fb6fa9 (diff)
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.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/DB/Users.pm2
-rw-r--r--lib/VNDB/Util/Auth.pm2
2 files changed, 2 insertions, 2 deletions
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"}
}