mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-27 17:16:14 +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 ''; | 		return ''; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	function spawnPrivilegeStates(member, privileges, types) { | 	function spawnPrivilegeStates(cid, member, privileges, types) { | ||||||
| 		const states = []; | 		const states = []; | ||||||
| 		for (const priv in privileges) { | 		for (const priv in privileges) { | ||||||
| 			if (privileges.hasOwnProperty(priv)) { | 			if (privileges.hasOwnProperty(priv)) { | ||||||
| @@ -189,8 +189,11 @@ module.exports = function (utils, Benchpress, relative_path) { | |||||||
| 		return states.map(function (priv) { | 		return states.map(function (priv) { | ||||||
| 			const guestDisabled = ['groups:moderate', 'groups:posts:upvote', 'groups:posts:downvote', 'groups:local:login', 'groups:group:create']; | 			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 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']; | 			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 = | 			const disabled = | ||||||
| 				(member === 'guests' && (guestDisabled.includes(priv.name) || priv.name.startsWith('groups:admin:'))) || | 				(member === 'guests' && (guestDisabled.includes(priv.name) || priv.name.startsWith('groups:admin:'))) || | ||||||
| 				(member === 'spiders' && !spidersEnabled.includes(priv.name)) || | 				(member === 'spiders' && !spidersEnabled.includes(priv.name)) || | ||||||
|   | |||||||
| @@ -54,7 +54,7 @@ | |||||||
| 						<input autocomplete="off" type="checkbox" class="form-check-input float-none checkbox-helper"> | 						<input autocomplete="off" type="checkbox" class="form-check-input float-none checkbox-helper"> | ||||||
| 					</div> | 					</div> | ||||||
| 				</td> | 				</td> | ||||||
| 				{function.spawnPrivilegeStates, privileges.groups.name, ../privileges, ../types} | 				{function.spawnPrivilegeStates, cid, privileges.groups.name, ../privileges, ../types} | ||||||
| 			</tr> | 			</tr> | ||||||
| 			{{{ end }}} | 			{{{ end }}} | ||||||
| 		</tbody> | 		</tbody> | ||||||
| @@ -133,7 +133,7 @@ | |||||||
| 						<input autocomplete="off" type="checkbox" class="form-check-input float-none checkbox-helper"> | 						<input autocomplete="off" type="checkbox" class="form-check-input float-none checkbox-helper"> | ||||||
| 					</div> | 					</div> | ||||||
| 				</td> | 				</td> | ||||||
| 				{function.spawnPrivilegeStates, privileges.users.username, ../privileges, ../types} | 				{function.spawnPrivilegeStates, cid, privileges.users.username, ../privileges, ../types} | ||||||
| 			</tr> | 			</tr> | ||||||
| 			{{{ end }}} | 			{{{ end }}} | ||||||
| 		</tbody> | 		</tbody> | ||||||
|   | |||||||
| @@ -41,7 +41,7 @@ | |||||||
| 				</td> | 				</td> | ||||||
| 				<td></td> | 				<td></td> | ||||||
| 				<td class="text-center"><input autocomplete="off" type="checkbox" class="checkbox-helper"></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> | 			</tr> | ||||||
| 			{{{ end }}} | 			{{{ end }}} | ||||||
| 		</tbody> | 		</tbody> | ||||||
| @@ -104,7 +104,7 @@ | |||||||
| 					<!-- need this empty --> | 					<!-- need this empty --> | ||||||
| 				</td> | 				</td> | ||||||
| 				<td class="text-center"><input autocomplete="off" type="checkbox" class="checkbox-helper"></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> | 			</tr> | ||||||
| 			{{{ end }}} | 			{{{ end }}} | ||||||
| 		</tbody> | 		</tbody> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user