Residence Permissions
Very simple plugin adding temporary permissions to your Residences
Requires
Why the plugin
I use on my server rescreative, player entering residence get creative mode, then they can get items, and sell them using /sell command from essentials, so with this plugin i can remove permission to /sell on that residence.
Now with flag support You can create own flags giving player permissions, example flag preventing using mcMMO skills, or flag allowing LWC creation.
What does it do
Adds additional permissions to player on residence change.
Example Configuration
Negative Permissions doesn't work, you can set world flag "lwc" and set "-lwc" on residences.
config.yml:
debug:true # display debug in console, default: false
flags.yml - list of residence flags
emptynonusableandmore: desc: empty flag used to disable config recreate perms: [] lwc: desc: allow creating lwc protected blocks perms: - lwc.protect #LWC magic: desc: enables magic in residence perms: - magicspells.cast.* #MagicSpells mcmmo: desc: enables skills and abilities mcmmo mcmmo perms: - mcmmo.ability.* - mcmmo.skills.*
res.yml
res2: # residence name - example.permission # permission to add while player is on residence rez5-test: # residence-subzone name - someplugin.fly - someplugin.warp market-shop-player: # residence market, subzone shop, subzone player - someplugin.perm
Commands
- /resperm debug - toggle console debug
- /resperm reload - reload configuration files
- /resperm resreload - reload res.yml
Permissions
- resperm.toggledebug - access to /resperm debug command
Future Idea
- Replace - with . (still working on bukkit config pathSeparator problem)
- Add more commands
- Add more permissions
- Add "perm" flag to set permissions only to player with this flag
- Add predefined flags with permissions, example "market" flag will add permission to create/use trade signs.
How to install
- Drop jar into plugins folder.
- Run server
How to use
- open plugins/resperm/res.yml
- configure additional permissions to residences
- type in server console resperm resreload
- test it
- If something dosn't work, type in console resperm debug
- test it
- post new ticket with console output
Source
Included in jar
Known Bugs
- Negative permissions doesn't work
- Lots of overuse possibilities ;)
- Residence doesn't fire event on player teleport, so after warp player still can have permission.
Suggestions
Do you like to change something? Create Ticket :) Have some idea? Create Ticket :)
This plugin's slug is quite funny xD
@disciple218
Negative doesn't work in resperm, so if PEX overrides resperm totally the only choice that can be done is modify the defaults in jar files, but one stupid move forces next stupid move ...
I need to rethink it really hard ... because if plugin has defaults true, then resperm is useless....
I used the global flags section under Groups for the new perm flag I created, but resperm won't grant them if PEX grants the negative nodes. Maybe I'll try adding the negative perms in the res.yml file and see if that works.
EDIT: I just looked, and there doesn't seem to be a way to add global permissions.
@disciple218
"So because of this, PEX sees the negative perms instead of the ones granted through the residence flag I created."
So if you add a negative in pex, you can't add positive using flags? Or If you set negative then res flags override and adds them?
@disciple218
I know only 2 solutions:
1. Create group in residence, because different group can have different global world flags, so you can do this using residences, but it can't be done in some solution. If you would want to disable flag only for one person, because it is only "group managed".
2. I can add permission to check for flags, but i still think about implementation.
Ok, it is working the way you explained to set it up. I do have another problem, though, and maybe you can suggest something.
Two of my plugins (mcMMO and Jobs) grant default perms. However, I don't want my lowest ranked group to have them, so i have to grant the negative perms -mcmmo.* and -jobs.* to this low rank so they do not have access, and then grant the regular perms to the higher rank that I allow access. So because of this, PEX sees the negative perms instead of the ones granted through the residence flag I created. Can you think of a way around this? Thanks!
@kolorafa
Your plugin information above doesn't say anything about setting it up this way. Your opening statement simply talks about REMOVING the /sell perm in a residence, not removing it from the permissions manager, adding it to Residence global flags, and then setting that flag to false on the desired residence.
I will try it this way, but please explain this above so others aren't confused about how, exactly, this plugin works. Thanks.
@disciple218
"but I need to restrict a bunch of other perms too, like trade signs and our auction plugin."
As i write you in PM you can do this!
For example, you want to restrict "essentials.sign.trade", what do you do:
Now you can trade everywhere except that residence, and thats work with 99% of plugins because good plugins uses native bukkit permission check (that Pex binds to) so with pex you have a really good support but even without pex you can use it.
.
I did check PEX API on Wiki and i will not use it to add/remove Permissions because they are Permament permissions and because of that in time it can be something like that:
Example: you add "permission.something" to your residence, player entered residence, player got permission, server somehow went offline, you remove this flag from residence, player entered the game, and guess what, PLAYER WILL STILL HAVE THAT PERMISSION ! even when you removed it because he has it in his user perms.
Thats why i use Temporary bukkit permission system that doesn't mix with other settings.
Example: If you add positive permission and negative even from Pex documentation you have 50% chance that you will have that permission and other 50% that you will not, because pex doesn't compute permissions, he checks from top to bottom and return first occurrence for performance, thats good, so if you want to DISALLOW something in a region don't give it at all in Permission plugin and add this to residence flags.
I will be happy to hear what you think about it, correct me if I'm wrong.
If it won't be able to fix this in time in bukkit then i will add 3 option, "Append" and "Remove" group from Pex, so when entering residence you will be granted not permissions but group, but i don't know what about supporting multiple group with other plugins, i know that Pex supports it. But still, adding someone to group doesn't guarantee that he will be denied to use something, because as i said before, its "from top to bottom, first occurrence check"
"Thanks for adding the AlphaChest flag"
Your welcome, but i didn't add AlphaChest do plugin, just add world flag support :)
@kolorafa
PEX and Vault are Bukkit mainstays, I don't think you'll get much interest in this plugin without supporting them.
Thanks for adding the AlphaChest flag, but I need to restrict a bunch of other perms too, like trade signs and our auction plugin.
Hoping this gets fixed soon! Keep up the good work! :)
@disciple218
res.yml and flags.yml are using the same permission system and using superperms (hasPerm), AlphaChest using that system, so it's now Pex solution.
I probably will not add native Pex/Vault if they doesn't have "temporary" permissions (i will check them later, if they have i will implement it), this plugin should never add permanent permissions.
So it should work, i did add (like AlphaChest says) "-alphachest.chest" permission but ...
Adding "-bukkit.command.me" in PEX doesn't work for me as well.
Did you try adding some permissions because it probably problem with negative perms?
I tested it and PermissionAttachment ignores false value, i'm trying to figure it out why.
In next release (v0.5) you will be able to set "alphachest" flag globally on specific world, and set /res set alphachest false in that residence, but that is not best solution idea for performance ...
@kolorafa
I was trying to add a perm for AlphaChest, to prevent people using it while in a zone with the creative flag.
I tried making a flag called 'nome' with the perm -bukkit.command.me and it still doesn't work. Do you plan on supporting PEX, or Vault for that matter?
EDIT: I tried adding these perms to the res.yml file too, with the same results.
@disciple218
Permissions will not be seen in pex, because it adds temporary permissions to user (bukkit handling)
What permissions are you adding? Maybe plugin is using a native pex permission check?
Try for example: bukkit.command.kick and try to kick someone from server.
If you can PM me your server address and plugin list, i will check them.
I can't get this to work. I changed the flags.yml, Residence recognizes and sets the flag, and console message says it's giving the perm to the player, but they don't have it.
I'm using PEX v1.19.2 with the SQL backend.