Howto : Permission Service

Hello there,

I’m currently dealing with permission management with my plugin. At first, I had two choices : manage permission via an external plugin (like pex, bwt is there another one implementing the perm service yet ?) or dive into the abyss of handling permissions myself.

My situation being perticuliar, I have to choose option 2. Therefore I have two questions :

Is it possible to give (or not to give) permissions to players (ie acting like pex) without implementing the permission service ?

If not, despite the javadocs of the service being very complete, I still have difficulties to understand what are the roles of all these interfaces to implement and those methods to override :wink: . I saw that the official docs aren’t yet completed for that. Is there any good tutorial/docs/code examples about the permission service ?

There is a new manager called ExtraPermissions, it is still pretty alpha but it works fairly well for basic setups.

Roles are basically templates for permission services to use.

There are 3 roles included in Sponge, which are admin, staff and user, which I believe correspond to differing op levels in vanilla minecraft.

By creating PermissionDescriptions and registering them with the permissions service, you can hint to the service at what the default permissions for your plugin should be, and who they should be assigned to.

I believe that the default sponge permission service will allocate user permissions to all users, and admin and staff to ops. I do not know what op level the staff role corresponds with.