feat(users): govern profiles and access

Normalize fixed profile fields, profile actions, and the five-column capability matrix for comments, uploads, and downloads.
This commit is contained in:
kate522 committed 2026-08-13 00:24:54 +08:00
1 parent 0b06b2c7df
commit 8241570ca2
67 files changed
+780 -1127

No files matched your search

+6 -1
View File
@@ -17,7 +17,12 @@ trait AuthReader {
/** 是否要求注册用户才能评论 */
public static function comment_requires_registration(): bool {
return !empty(self::get_value('comment_require_login', false)) && self::comment_enabled();
if (!self::comment_enabled()) {
return true;
}
$user_id = get_current_user_id();
return !class_exists(Capabilities::class) || !Capabilities::user_can('comment_add', $user_id);
}
/** 是否允许注册 */