-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users can invite more than his limit approves #1690
Comments
I was planning to fix it, but then I notice one large issue. My fix can be bypassable if the island owner invites players to the team and logout. BentoBox does not offer permission checks for offline players, and team size is defined only by owner permission. This means that we should either handle permissions for offline users or rethinking the ways how permissions are applied and used. I could suggest storing permissions on island objects. When the owner login, these permission values are updated. Any thoughts @tastybento and @Poslovitch |
With PR #1689 I not only added the homes to the Island object, but also the max number of homes to it. This was for the same reason as this issue - the island should "know" its own limits and not rely on dynamic checking of permissions. The permissions can still be checked and used to update the Island object both when the owner logs in or during invite operations (invite and acceptance), but the max member value should decide whether the invite can be accepted or not. So, here's my suggestion - let's do a PR where we add max members to the Island object (and max homes). Then the team code can be adjusted to use this value and update it based on player perms. The login listener can be adjusted to update the value. |
* Adds maxMembers to the Island object for persistent storage #1690 * Expanded approach to include coop and trusted ranks. * Checks for max members/coops/trusts on accept based on island setting. * Write island max member/coop/trusted if owner joins server This updates the island's settings based on the owner's permissions.
Description
Describe the bug
This issue allows to invite more user than your limit is. So if the player has maxsize of 2, he can invite more.
Steps to reproduce the behavior
Expected behavior
Player that were invited should not be added to the team, if the teamlimit of the owner is already full. Their invites should be discarded.
Screenshots and videos
Oneblock:
Skyblock:
Environment
Output of
/bbox version
(Mandatory)Plugins (Optional)
Plugins (27): AAC5, AutoPluginLoader, BentoBox, dynmap*, Essentials, GSit, HolographicDisplays, Images, LuckPerms, MaSuiteCore, MaSuiteHomes, MaSuitePortals, MaSuiteTeleports, MaSuiteWarps, NamelessMC, NetworkManager, PlaceholderAPI, ProtocolLib, spark, TAB-BukkitBridge, Vault, VoidGenerator, WorldEdit, WorldGuard, WorldGuardExtraFlags
The text was updated successfully, but these errors were encountered: