feat(admin): plate moderator roles, advanced limits, coupon scope edit/batch
This commit is contained in:
1 parent
733a1670ec
commit
deee48245f
8 files changed
+849
-338
No files matched your search
@@ -252,10 +252,15 @@ trait AKSRT_Forum_Board_Service_Part_2 {
|
||||
}
|
||||
|
||||
$add_limit = (string) (get_post_meta($plate_id, '_aksrt_add_limit', true) ?: 'all');
|
||||
if ($add_limit === 'all') {
|
||||
if ($add_limit === 'all' || $add_limit === 'login') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Moderators already returned true above.
|
||||
if ($add_limit === 'moderator') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = get_userdata($user_id);
|
||||
if (!$user) {
|
||||
return false;
|
||||
@@ -269,7 +274,8 @@ trait AKSRT_Forum_Board_Service_Part_2 {
|
||||
return !empty(array_intersect($user->roles, $allowed_roles));
|
||||
}
|
||||
|
||||
return true;
|
||||
// Unknown contract → deny (no legacy fallthrough).
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user