You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FactionsUUID has a functionality called Admin Bypass mode. This allows server administrators to bypass faction restrictions for administrative purposes (such as accessing/interacting with blocks, placing/destroying blocks, etc.). When a server administrator with proper permission runs the /f bypass command, it then toggles a boolean value that can be accessed through the isAdminBypassing() method found in the FPlayer API. This is true when enabled, and false when disabled. You can see this here: https://github.com/FactionsU/UID/blob/main/src/main/java/com/massivecraft/factions/FPlayer.java#L87
Currently, the FactionsUUIDProtectionModule that integrations FactionsUUID with dough does not take into account when a user might have admin bypass mode enabled. It currently only checks if the current player is a member of the faction and if so, hasPermission returns true (it will also return true if the land is currently not claimed by anyone). Otherwise, it will return false. This logic is incorrect however, as one other condition that needs to be accounted for is if the player is currently in admin bypass mode, as if they are, they have access to all factions, regardless of if they are a member of that faction.
Steps to reproduce the Issue (Required)
Install the latest version of FactionsUUID with the latest version of SlimeFun4.
Create a SlimeFun machine - it can be anything. For example, an Enhanced Crafting Table.
Claim the chunk for your faction where you placed the machine (steps 2 and 3 can be done in reverse if desired)
Have another player (not of your faction) attempt to use the machine (with admin bypass disabled)
It correctly blocks them from using it (as it should)
Enable admin bypass mode for the other user not of your faction
Have them attempt to use the machine again
Despite being in bypass mode, they are still not able to use the machine
Expected behavior (Required)
When using SlimeFun (and by extension, dough) with FactionsUUID, if a server administrator enters Faction Admin Bypass mode, the permissions check should succeed, as admin bypass mode gives them access to all factions.
Server Log / Error Report
There are no errors as this is technically working as written. It is just a condition that is not currently being accounted for in the code.
Server specs (Required)
This has been tested on Paper, MC1.20.4 (current RC37), but it also occurs on the newest builds that have not yet been published (such as recent builds adding MC1.21 support).
Java Version: 21.0.6
Server Software: Tested on...
Paper 1.20.4 build 499
Paper 1.21.4 build 121
Minecraft Version:
MC 1.20.4
MC 1.21.4
FULL plugins list (Required)
I tried this on a fresh test server install to rule out any conflicts running only the following:
Description (Required)
FactionsUUID has a functionality called Admin Bypass mode. This allows server administrators to bypass faction restrictions for administrative purposes (such as accessing/interacting with blocks, placing/destroying blocks, etc.). When a server administrator with proper permission runs the
/f bypass
command, it then toggles a boolean value that can be accessed through theisAdminBypassing()
method found in theFPlayer
API. This is true when enabled, and false when disabled. You can see this here: https://github.com/FactionsU/UID/blob/main/src/main/java/com/massivecraft/factions/FPlayer.java#L87Currently, the FactionsUUIDProtectionModule that integrations FactionsUUID with dough does not take into account when a user might have admin bypass mode enabled. It currently only checks if the current player is a member of the faction and if so,
hasPermission
returns true (it will also return true if the land is currently not claimed by anyone). Otherwise, it will return false. This logic is incorrect however, as one other condition that needs to be accounted for is if the player is currently in admin bypass mode, as if they are, they have access to all factions, regardless of if they are a member of that faction.Steps to reproduce the Issue (Required)
Expected behavior (Required)
When using SlimeFun (and by extension, dough) with FactionsUUID, if a server administrator enters Faction Admin Bypass mode, the permissions check should succeed, as admin bypass mode gives them access to all factions.
Server Log / Error Report
There are no errors as this is technically working as written. It is just a condition that is not currently being accounted for in the code.
Server specs (Required)
This has been tested on Paper, MC1.20.4 (current RC37), but it also occurs on the newest builds that have not yet been published (such as recent builds adding MC1.21 support).
FULL plugins list (Required)
I tried this on a fresh test server install to rule out any conflicts running only the following:
For MC 1.20.4:
For MC 1.21.4 (not officially supported yet, but just to see if newer builds have the same issue):
Other Notes
This should be pretty simple to update. I can send up a PR with this change. It would basically just be a change to this method:
to something like this:
The text was updated successfully, but these errors were encountered: