[Discontinued/Not available anymore] SimplePermissions [API 4.1+ & 5]

This project has been discontinued.


SimplePermissions is a simple, very basic permissions plugin for Sponge.

Major features:

  • Very easy to use basic commands
  • Working /op and /deop commands
  • Lightweight
  • No configuration file to manually edit - ready to use
  • Per user and per group permissions
  • Users can have multiple groups assigned
  • Groups can have a parent group (group permissions inheritance)
  • Weighted groups (groups can have higher priority)
  • Explicit deny permission (- prefix, negates a permissions)
  • Permission node wildcard (* suffix)
  • Options support

Links:

Commands:

  • /puser <user> [<add|remove|setgroup|addgroup|removegroup|option|test>] [<permission|group>] - manage users permissions
  • /pgroup <group> [<create|delete|add|remove|parent|weight|option|test>] [<permission|group|weight>] - manage groups permissions
  • /pgroups - list available groups
  • /ptest <permission> - test if you have the specified permission (alias for /puser <yourname> test <permission>)
  • /pdebug <true|false> - print debug informations on the server log (like which permissions are being requested and the result)
  • /op <user> - makes a player op (gives access to all permissions)
  • /deop <user> - deops a a player (removes the previous given access to all permissions)

Commands examples:

  • /puser KaiNoMood - show info about the player KaiNoMood
  • /pgroup default add minecraft.command.say - set the ‘minecraft.command.say’ permission node as default
  • /pgroup admin create - create the ‘admin’ group
  • /pgroup admin add * - set all permissions for the admin group (basically they get all permissions)
  • /puser KaiNoMood addgroup admin - add KaiNoMood to the admin group
  • /puser KaiNoMood option OptionKey This is the option value - set an option to KaiNoMood

Permissions configuration example with 3 players, 2 groups and the default group:

Configuration:
  • Add the permission nodes “perm.alpha” and “perm.beta” to the default group.
  • Add the permission nodes “-perm.beta” (perm.beta set to false), “perm.gamma”, and “-perm.delta” to the mod group.
  • Add the permission nodes "perm.delta to the admin group.
  • Set mod as a parent of the admin group. (this means that the admin group will inherit mod’s permissions)
  • Player A is not in any group, Player B is in the mod group, and Player C is in the admin group.
Result:
  • Player A will have “perm.alpha” and “perm.beta” permission nodes set to true.
  • Player B will have “perm.alpha” and “perm.gamma” permission nodes set to true, and “perm.beta” and “perm.delta” permission nodes set to false.
  • Player C will have “perm.alpha”, “perm.gamma” and “perm.delta” permission nodes set to true, and “perm.beta” permission node set to false.

Notes:

  • Default group is “default”. You cannot rename it. All players are always on the default group (even if you set another group to the player, everyone is still secretly member of the default group).
  • If you need chat prefixes/suffixes, check this.
  • You can also test options with /ptest option:[key]. e.g. if you want to check the “testoption” option, do /ptest option:testoption
4 Likes

Looks very simple, I need such things for testing the permissions of my own plugins :slight_smile:
You could use the GameReloadEvent triggered by /sponge plugins reload to replace the /preload command.

1 Like

Seems legit xD I’ll add that too!

My thoughts exactly! Will there be any builds for 4.x?

Uhhhh I may make it if it is useful! I thought there were enough permissions plugins for SpongeAPI 4.x

New version 0.9.1.

Changes:

  • Removed /preload, use /sponge plugins reload instead
  • Added support for permission deny with the - prefix (e.g. -minecraft.command.give)
  • Added support for permission node wildcard with the * suffix (e.g. minecraft.command.*)

The server threw this exception during startup.

The mod does not properly save/load permissions.

[Server thread/ERROR] [Sponge]: Could not pass ChangeServiceProviderEvent$Impl to sponge
java.lang.UnsupportedOperationException: Identifier commandblock is not implemented yet.

Hey! Thanks for adding to the Sponge ecosystem!

I do have one quibble: Please don’t include “Sponge” in your plugin name.
We reserve the use of Sponge in titles for official SpongePowered works.
Sorry to be a wet blanket, but that’s the way we want things.

Hey thank you for your report. I will fix it today.

Hello. You may want to specify that somewhere in your SpongeDocs.

You are quite correct, and a Pull Request to change this is in progress. We apologise for the inconvenience.

Version 0.9.3 is out.

@Austragus Please let me know if your issue got fixed with this update. Thank you!

Major Changes:

  • Removed all UnsupportedOperationExceptions
  • Bugfix: added permissions not working until server restart
  • Bugfix: groups not working correctly in certain conditions
  • Tested with spongeforge-1.10.2-2002-5.0.0-BETA-1531

Note:
You can add * permission to an user or group to give him all permissions. You can also add -* permission to an user or group to deny all permissions.

All changes can be found on GitHub.

1 Like

Version 0.9.4 is out.

Major changes:

  • Bugfix: NPE on plugin load

Version 0.9.5 is out.

Added SpongeAPI 4.1 support as suggested by @mmonkey

1 Like

Hi all!

I’m testing SimplePermissions with SpongeForge 1.10.2, and i have noticed that groups do not save.
I have tried doing /pgroup admin create, and i get “[21:03:02] [Server thread/INFO]: Group admin created” in the log.

See ya!

P.D: I’m using SimplePermissions-0.9.5 jar.

Hey! Thank you for your report! Are you actually adding any permission to the group? Otherwise it gets deleted because it’s unused!

LOL, i didn’t know that :open_mouth: .
No, i didn’t add any permissions to the group :sweat: .

See ya!

1 Like

Just a quick question. Should all permissions everywhere be lower case as a standard?

I’ve downloaded a plug-in that requires permissions with upper case characters in it. But SimplePermissions seems to take the stance that all permissions should be lower case. I let them know, but I thought I would ask here anyhow.

Depends on the permissions provider I think, if the plugin registers something with uppercase letters, and the permissions provider see’s them as equivalent because it changes everything to lower case, then the permissions provider wins.

SimplePermissions converts all the permissions to lower case. Also when a plugin checks for a permission value, converts the permission to check to lower case, making it “case-insensitive” (both the stored permission string and the requested permission string are converted to lower case)

Unfortunately I missed some “to lower case” methods, and this should be fixed on v.0.9.6 that I just uploaded. Thank you for your report!

1 Like