mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: remove some privs from fediverse in world category
This commit is contained in:
@@ -175,7 +175,7 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function spawnPrivilegeStates(member, privileges, types) {
|
||||
function spawnPrivilegeStates(cid, member, privileges, types) {
|
||||
const states = [];
|
||||
for (const priv in privileges) {
|
||||
if (privileges.hasOwnProperty(priv)) {
|
||||
@@ -189,8 +189,11 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
return states.map(function (priv) {
|
||||
const guestDisabled = ['groups:moderate', 'groups:posts:upvote', 'groups:posts:downvote', 'groups:local:login', 'groups:group:create'];
|
||||
const spidersEnabled = ['groups:find', 'groups:read', 'groups:topics:read', 'groups:view:users', 'groups:view:tags', 'groups:view:groups'];
|
||||
const fediverseEnabled = ['groups:view:users', 'groups:find', 'groups:read', 'groups:topics:read', 'groups:topics:create', 'groups:topics:reply', 'groups:topics:tag', 'groups:posts:edit', 'groups:posts:history', 'groups:posts:delete', 'groups:posts:upvote', 'groups:posts:downvote', 'groups:topics:delete'];
|
||||
const globalModDisabled = ['groups:moderate'];
|
||||
let fediverseEnabled = ['groups:view:users', 'groups:find', 'groups:read', 'groups:topics:read', 'groups:topics:create', 'groups:topics:reply', 'groups:topics:tag', 'groups:posts:edit', 'groups:posts:history', 'groups:posts:delete', 'groups:posts:upvote', 'groups:posts:downvote', 'groups:topics:delete'];
|
||||
if (cid === -1) {
|
||||
fediverseEnabled = fediverseEnabled.slice(4);
|
||||
}
|
||||
const disabled =
|
||||
(member === 'guests' && (guestDisabled.includes(priv.name) || priv.name.startsWith('groups:admin:'))) ||
|
||||
(member === 'spiders' && !spidersEnabled.includes(priv.name)) ||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<input autocomplete="off" type="checkbox" class="form-check-input float-none checkbox-helper">
|
||||
</div>
|
||||
</td>
|
||||
{function.spawnPrivilegeStates, privileges.groups.name, ../privileges, ../types}
|
||||
{function.spawnPrivilegeStates, cid, privileges.groups.name, ../privileges, ../types}
|
||||
</tr>
|
||||
{{{ end }}}
|
||||
</tbody>
|
||||
@@ -133,7 +133,7 @@
|
||||
<input autocomplete="off" type="checkbox" class="form-check-input float-none checkbox-helper">
|
||||
</div>
|
||||
</td>
|
||||
{function.spawnPrivilegeStates, privileges.users.username, ../privileges, ../types}
|
||||
{function.spawnPrivilegeStates, cid, privileges.users.username, ../privileges, ../types}
|
||||
</tr>
|
||||
{{{ end }}}
|
||||
</tbody>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</td>
|
||||
<td></td>
|
||||
<td class="text-center"><input autocomplete="off" type="checkbox" class="checkbox-helper"></td>
|
||||
{function.spawnPrivilegeStates, privileges.groups.name, ../privileges, ../types}
|
||||
{function.spawnPrivilegeStates, cid, privileges.groups.name, ../privileges, ../types}
|
||||
</tr>
|
||||
{{{ end }}}
|
||||
</tbody>
|
||||
@@ -104,7 +104,7 @@
|
||||
<!-- need this empty -->
|
||||
</td>
|
||||
<td class="text-center"><input autocomplete="off" type="checkbox" class="checkbox-helper"></td>
|
||||
{function.spawnPrivilegeStates, privileges.users.username, ../privileges, ../types}
|
||||
{function.spawnPrivilegeStates, cid, privileges.users.username, ../privileges, ../types}
|
||||
</tr>
|
||||
{{{ end }}}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user