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:
1 parent
0b06b2c7df
commit
8241570ca2
67 files changed
+780
-1127
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
/** 是否允许注册 */
|
||||
|
||||
Reference in new issue
Block a user