Commit Graph

103 Commits

Author SHA1 Message Date
HaHaWTH 7e49e26735 reupload files 2023-07-11 20:45:01 +08:00
HaHaWTH b014da245d Del all files 2023-07-11 20:42:24 +08:00
ljacqu 9fd532d798 Minor: Rename StringUtils#isEmpty to #isBlank
- Better fits the naming used by other tools and also the JDK (String#isBlank as of JDK 11)
2022-12-30 08:44:29 +01:00
David Maes d969d314b3 LuckPerm: keep contexts active after reload of groups (#2186)
* Use context aware groups

* Revert "Use context aware groups"

This reverts commit 5adc6ef7

* Keep luckperm contexts after authentication

* Code cleanup

* Code cleanup

* Fix nullpointer for context maps

* Code cleanup

* Use uuids for sqlite and postgresql

* Revert "Use uuids for sqlite and postgresql"

This reverts commit 05296e5f23bd4379a89647656f08432c718e6f9c.

* Cleanup imports

* Fix test

Co-authored-by: David Maes <david.maes@kbc.be>
2021-08-21 22:19:45 +02:00
Gabriele C d30580d5d4 Listener optimizations (#1884)
* Drop CraftBukkit support, listeners cleanup

* Codestyle

* Codestyle

* Remove useless player.saveData() calls

* Micro optimization on the join process

* Requested changes

* Fix unit test

* Test onPlayerHeldItem listener

* Requested changes

* Remove unused import
2019-08-11 23:47:50 +02:00
ljacqu c34f00f759 #1874 Introduce individual ConsoleLogger instance per class (#1875)
* #1874 Introduce individual ConsoleLogger instance per class
- Create ConsoleLoggerFactory from which a separate logger can be created for each class
- Allows to support individual log level settings in the future

* Fix CodeStyle issue

* Replace full class name with import

* Update usages after merge from master
2019-08-06 15:15:16 +02:00
Gabriele C ce4bb43dee Remove bPermissions support 2019-05-02 10:42:24 +02:00
Gabriele C c11e4b9f15 Remove 1.7 support 2018-11-30 09:23:30 +01:00
ljacqu 58e04556ee Checkstyle: Add 'WhitespaceAfter' check, fix some violations 2018-09-01 08:38:14 +02:00
Gabriele C 6e16abc34e Don't purge users if unable to load permission data 2018-04-19 11:45:21 +02:00
ljacqu 7864bb06ac Minor cleanups
- Fix line length violations
- Add JavaDoc to some longer methods
- Remove unused imports
2018-02-23 23:23:24 +01:00
sgdc3 a92084ec60 Fix the deploy system 2018-01-29 15:08:59 +01:00
ljacqu 6f2c586441 Test initialization of permission handlers in PermissionManager 2018-01-21 22:11:47 +01:00
ljacqu 44a7baff9a #1350 Add option to force using the sync PlayerLoginEvent
- Introduce new configuration (taken from @sgdc3)
- Create JoiningPlayer, based on a Player object or String name, determining how permissions will be checked
2017-11-01 21:02:22 +01:00
Gabriele C a5542051f4 Add a way to load user's permission data from the permission handler on demand.
#1350
2017-10-29 19:35:23 +01:00
Gabriele C d8d87c8b67 Add option to force using the generic Vault permission handler hook
Requested in #1350
2017-10-29 11:47:38 +01:00
Gabriele C f754331de6 Implement LuckPerms permission handler
#1324
2017-09-14 20:39:15 +02:00
Gabriele C 2fbdd46919 #1298 Make permission manager accept OfflinePlayers + fix permission purge 2017-09-03 02:07:00 +02:00
Gabriele C b96ae61697 Remove some old plugin hooks, update dependencies 2017-08-31 11:47:55 +02:00
ljacqu f150668fc1 Minor - remove unused imports
- As determined by CodeClimate
2017-07-02 11:00:17 +02:00
Gabriele C c758e15cd7 Store the entire player's list of groups instead of primary group 2017-07-01 19:18:42 +02:00
ljacqu 1f8307c8f6 Fix minor checkstyle issues
- Add JavaDoc where checkstyle expects it
- Fix line too long issues
- ...
2017-05-07 11:59:01 +02:00
ljacqu e0e4cd112d #761 Restore permission group in sync with limbo players
- Couple AuthGroupHandler closer to the LimboService: whenever a limbo player is restored, the auth group should be restored as well. This fixes some consistency issues.
- Move AuthGroupHandler into limbo package and make it package-private
- Change permission handler to skip any empty groups (prevents odd command output e.g. for BukkitPermissions)
2017-04-29 22:37:34 +02:00
ljacqu 32a664ef59 Update checkstyle config and CodeClimate exclusions
- Add new checkstyle checks: require Javadoc on large private methods, default in switch, declaration order & others
- Update path exclusions in CodeClimate config to match newly renamed classes (e.g. PHPBB -> PhpBB)
  - Create consistency check testing that excluded paths exist as classes
- Fix some trivial violations
2017-03-23 10:34:28 +01:00
ljacqu 350ef9b5e6 PermissionHandlers: add default methods for trivial duplications
- Add easy default methods on PermissionHandler interface (override whenever there's a better way!)
- Change getGroups() signature to return a Collection instead of a List
2017-01-29 18:16:17 +01:00
ljacqu 95945ffd22 #761 Improve permissions group support
- Drop one auth group type in favor of three: logged in, registered but not logged in, and unregistered
- Move  properties to same parent path
2017-01-29 17:44:06 +01:00
Xephi59 de97c60b5d FixMe from Gnat008 : Add PermissionsBukkit groups support 2016-12-20 21:35:26 +01:00
ljacqu 7d65d2a7c4 Fix various code issues as detected by Sonar
Mostly minor changes:
- Add deprecated javadoc tag on deprecated members
- Reduce duplication (FlatFile, BackupService, ...)
- Make methods static
- Reduce size of anonymous classes
- Replace name with displayName in PermissionsSystemType (avoids confusing with Enum name())
- Tabs to spaces
- Merge if statements

Code from third-party sources (BCryptService, BinTools, PHPBB) not modified.
2016-11-22 18:20:55 +01:00
Gabriele C 7deb75ab85 Deprecate GroupManager handler 2016-09-04 13:29:01 +02:00
ljacqu dd27ff7daa #872 Use Player#hasPermission instead of custom PermissionHandler method
- Use Player#hasPermission to check if a player has a permission
- Remove hasPermission method from PermissionHandler implementations
2016-08-31 21:27:43 +02:00
ljacqu bfcd28a9a1 Add all passed groups when adding new permission groups (fixes bug in unused code) 2016-08-27 21:27:06 +02:00
ljacqu 2a4cda0709 #784 Perform bypass purge permission check with OfflinePlayer objects
- Move permission check inside PurgeTask to perform it with OfflinePlayer objects instead of lowercase names
- Move purge members into child "purge" package
- Unify online and offline default permission behavior in DefaultPermission
2016-07-17 11:54:22 +02:00
ljacqu 1377b10c24 Simplify instantiation of permission handlers
- Change permission handler to retrieve the services it needs, instead of getting them from the PermissionsManager
- Reduce visibility of some methods
- Add Reloadable interface
2016-06-19 18:20:12 +02:00
ljacqu ff2f8a63bb Fix bugs in purge classes, cleanup
- OfflinePlayer objects were never mapped to names
- Essentials purge was run even if setting was disabled
- Console user saw messages twice
- Misc: trivial field reorderings, change DefaultPermission to be null safe
- Permissions: do not expose PermissionHandler just to get its type
2016-06-19 17:56:50 +02:00
Gnat008 16e9990723 implement checking permissions of an offline player 2016-06-17 20:49:03 -04:00
EbonJaguar 5870a4a433 Add ability to check permissions by player name 2016-06-14 22:47:35 -04:00
ljacqu 89bbfc48ee #723 Create provider for TimeoutTask and MessageTask, remove LimboCache#getInstance
- Create class to handle the creation of "LimboPlayer tasks" (adds encapsulation, reduces duplication)
- Move group setting into its own class because (mutual dependency between LimboCache and PermissionsManager otherwise)
2016-06-12 22:00:05 +02:00
ljacqu d6e1fd5ceb Use injection in and for LimboCache, migrate some legacy settings, remove setGroup from Utils
- New injector method allows to retrieve services if they've already been instantiated -> useful for onDisable() which might be run after aborted initialization
- Deprecate various methods that need to be removed
2016-06-12 16:14:34 +02:00
Gabriele C 01f297919d 1.10 API + cleanup 2016-06-11 17:46:24 +02:00
ljacqu 4fe26f08d4 #612 Check if plugin is permission system within method itself
- Iterate over all values within the method
- Bug fix: change method to use pluginName field, and not name
2016-06-04 22:40:30 +02:00
ljacqu 6d2597a980 #739 Fix command unit tests; adjust default handling
(cherry picked from commit 61c119b)
2016-06-02 23:12:01 +02:00
Gnat008 73272b5931 Remove all but one hasPermission() method in the PermissionsManager
#739 (cherry picked from commit 65f3347)
2016-06-02 23:11:47 +02:00
EbonJaguar c3d07cb9a4 #739 Cleanup on PermissionsManager
(cherry picked from commit d9ad12b)
2016-06-02 23:10:37 +02:00
ljacqu 95343e366b #314 Evaluate default permission on enum, remove default from handler interface
- Evaluate permission for DefaultPermission on the enum itself
- Remove boolean default from PermissionHandler for hasPermission()
- Remove some unused / intermediary hasPermission() flavors in PermissionsManager
2016-06-01 21:56:57 +02:00
EbonJaguar fdb9227ec1 Properly unhook the current system when unhook() is called 2016-06-01 14:09:30 -04:00
EbonJaguar e99d9414b8 Add and implement handlers for each individual permissions plugin, instead of doing everything in the PermissionsManager - see #314 2016-06-01 14:00:27 -04:00
EbonJaguar 3ad00a45f9 Move default permissions out of Commands and into PermissionNode - fixes #606 2016-05-30 16:47:48 -04:00
EbonJaguar 428b27943b Add isPermissionsSystem method to PermissionsSystemType enum - fixes #612 2016-05-29 18:29:19 -04:00
ljacqu b48e080324 Minor code householding
- Fix Javadoc errors reported during Jenkins build
- Use Guava methods in NewSetting where possible
2016-05-28 07:56:26 +02:00
ljacqu f014485789 Service injector - implement stricter requirements for PostConstruct methods
- Implement similar restrictions as prescribed by the PostConstruct documentation:
   - Class may have at most one method annotated with PostConstruct
   - PostConstruct method must return void
- Javadoc: replace mentions of injector construction where any injection method was meant
2016-05-19 21:50:48 +02:00