How do I convert my plugins permissions to vault?

Discussion in 'Plugin Development' started by Mike111177, Jul 9, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Mike111177

  2. I don't think you need to change anything as most of the plugins already hook into the native bukkit permissions.
     
  3. Offline

    Sleaker

    Mike111177 - as kumpel was saying, if all you're checking is if a player has permission you don't need to use Vault.
     
  4. Offline

    Mike111177

    then why when i use inheritance with pex it doesn't work?
     
  5. Offline

    pzxc

    If you want to convert to vault most (90%)of your permissions lookups will be player.hasPermission("some.permission"), just change that to perms.playerHas(player, "some.permission") where perms is the variables that holds the vault permissions object setup in your onEnable. Of course, all THOSE permissions checks should work with or without vault, to fix the other 10% you have to go through your code line by line and look for all the various permissions-related commands, checking a players group, changing groups, etc
     
  6. Offline

    Sleaker

    pzxc - no point in doing that, as I've said. Vault simply calls player.hasPermission("some.permission"); if you call perms.playerHas(player, "some.permission");

    Mike111177 - either your inheritance isn't actually inheriting in PEX, or you aren't actually setting up the permissions in PEX correctly. Again, PEX is compatible with the built-in Bukkit interface for checking permissions, if for some reason you think it's giving back incorrect results on permission checks, that would be something to check with PEX specifically.
     
  7. Offline

    Mike111177

    this is my plugin.yml is there anything wrong with it?
    Code:
    name: SteelSecurity
    version: 0.9.9-ab48
    main: net.othercraft.steelsecurity.SteelSecurity
    authors: [Mike111177, CorrieKay, r0306]
    website: [url]http://othercraft.net[/url]
    commands:
      sts:
         description: Base command for Steel Security.
         usage: /sts
      ticket: 
         description: Base command for for the ticket request system.
         usage: /ticket
    permissions:
      steelsecurity.*:
         description: Gives all benificial Steel Security permissions.
         children: 
            steelsecurity.commands.*: true
            steelsecurity.bypass.*: true
            steelsecurity.commands.vanish.cansee: true
            steelsecurity.notifications.*: true
      steelsecurity.bypass.*: 
         description: Gives permission to bypass all of Steel securitys checks.
         default: op
         children: 
            steelsecurity.bypass.anticaps: true
            steelsecurity.bypass.antiflood: true
            steelsecurity.bypass.loginlimiter: true
            steelsecurity.bypass.censor: true
            steelsecurity.bypass.blockblackist: true
      steelsecurity.commands.*: 
         description: Gives access to all Steel Security commands.
         default: op
         children: 
            steelsecurity.commands.sts: true
            steelsecurity.commands.help: true
            steelsecurity.commands.checkperm: true
            steelsecurity.commands.spectate: true
            steelsecurity.commands.listop: true
            steelsecurity.commands.checkgm: true
            steelsecurity.commands.reload: true
            steelsecurity.commands.vanish: true
      steelsecurity.commands.vanish.cansee:
         description: Gives access to see vanished people.
         default: op
      steelsecurity.notifications.*:
         description: Gives the player the ability to recieve all notifications from this plugin.
         default: op
         children: 
            steelsecurity.notifications.update: true
            
     
  8. Offline

    pzxc

    I know I've run into problems with accidentally putting a colon in the value of a YML entry, and on your fifth line you have "http://..."
     
  9. Well you say that steelsecurity.commands.* has, for example, steelsecurity.commands.sts as a children but you never defined that permission.
     
  10. Offline

    Mike111177

    uhh what? lol
     
  11. Offline

    EnvisionRed

    That's what kumpelblase was referring to. Nowhere in your plugin.yml do you define a steelsecurity.commands.sts permission.
     
  12. Offline

    Sagacious_Zed Bukkit Docs

  13. Offline

    Mike111177

  14. Offline

    Mike111177

    is this the right format?
    Code:
    name: SteelSecurity
    version: 0.9.9-ab48
    main: net.othercraft.steelsecurity.SteelSecurity
    authors: [Mike111177, CorrieKay, r0306]
    website: dev.bukkit.org/server-mods/steelsecurity
    commands:
      sts:
         description: Base command for Steel Security.
         usage: /sts
      ticket: 
         description: Base command for for the ticket request system.
         usage: /ticket
    permissions:
      steelsecurity.*:
        description: Gives all permissions for steelsecurity
        default: op
        children:
          steelsecurity.commands.*:
            description: Allows the player to use any command form this plugin
            children:
              steelsecurity.commands.sts:
                 description: Allows the player to use the /sts command
              steelsecurity.commands.stshelp:
                 description: Allows the player to use the /sts help command
              steelsecurity.commands.listop: 
                 description: Allows the player to use the /sts listop command
              steelsecurity.commands.gamemode:
                 description: Allows the player to use the /gm command
              steelsecurity.commands.checkgm:
                 description: Allows the player to use the /sts checkgm command
              steelsecurity.commands.spectate:
                 description: Allows the player to spectate other players
              steelsecurity.commands.reload:
                 description: Allows the player to reload the config
              steelsecurity.commands.vanish.*:
                description: Allows the player to do everything vanish related
                children:
                   steelsecurity.commands.vanish:
                      description: Allows the player to vanish
                   steelsecurity.commands.vanish.cansee:
                      description: Allows the player to see other vanished players
              steelsecurity.commands.ticket.*:
                description: Allows the player to remove items from other peoples inventory
                children:
                   steelsecurity.commands.ticket:
                      description: Allows the player to use the /ticket command
                   steelsecurity.commands.ticket.create: 
                      description: Allows the player to create a new ticket
                   steelsecurity.commands.ticket.claim:
                      description: Allows the player to assign a ticket to themself
                   steelsecurity.commands.ticket.assign:
                      description: Allows the player to assign a ticket to another player
                   steelsecurity.commands.ticket.list:
                      description: Allows the player to list all open tickets
                   steelsecurity.commands.ticket.veiw:
                      description: Allows the player to veiw a ticket that is not their own
                   steelsecurity.commands.ticket.comment: 
                      description: Allows the player to comment on a ticket
                   steelsecurity.commands.ticket.close.*:
                      description: Allows a player to close any ticket
                      children:
                         steelsecurity.commands.ticket.close.assigned:
                            description: Allows the player to close a ticket that he is assigned too.
                         steelsecurity.commands.ticket.close.all: 
                            description: Allows a player to close any ticket
                   steelsecurity.commands.ticket.open.*:
                      description: Allows a player to open any ticket
                      children:
                         steelsecurity.commands.ticket.open.assigned:
                            description: Allows the player to open a ticket that he is assigned too.
                         steelsecurity.commands.ticket.open.all: 
                            description: Allows a player to open any ticket
                   steelsecurity.commands.ticket.delete:
                      description: Allows the player to delete tickets
    
          steelsecurity.bypass.*: 
            description: Allows the player to bypass the various checks that the plugin does
            children:
              steelsecurity.bypass.censor:
                 description: Allows a player to bypass the Censoring
              steelsecurity.bypass.antiflood:
                 description: Allows a player to bypass the Anti Flood
              steelsecurity.bypass.anticaps:
                 description: Allows a player to bypass the Anti Caps
              steelsecurity.bypass.loginlimiter:
                 description: Allows a player to bypass the Login Limiter
              steelsecurity.bypass.blockblacklist:
                 description: Allows a player to bypass the Block Blacklist
    
          steelsecurity.notifications.*:
            description: Notifies the player in any event with this plugin
            children:
              steelsecurity.notifications.update:
                 description: Informs the player when there is an update for the plugin
              steelsecurity.notifications.ticket.*:
                 description: Informs the player about all ticket related event
                    children: 
                       steelsecurity.notifications.ticket.new:
                         description: Informs the player when there is a new ticket
    
     
Thread Status:
Not open for further replies.

Share This Page