Offline Permission Checks?

Discussion in 'BungeeCord Plugin Development' started by macguy8, Apr 24, 2013.

  1. Does anyone know if it's possible to check perms for Offline Players in BungeeCord? I currently have...

    public boolean isAdmin(String name) {
    return (getProxy().getConfigurationAdapter().getPermissions(name).contains("rank.Admin"));
    }

    , but it doesn't work at all (even for online players). My last resort would to have a text file (admins.txt), and store the names in the text file in memory, but I'd hate to add yet another permission system for server owners. Between permission systems local to the server and the BungeeCord perms, having another system in my plugin would be too much for most server owners. Is there a way to check offline perms I'm forgetting about?
     
    #1 macguy8, Apr 24, 2013
    Last edited: Apr 25, 2013
  2. This works, if you do it the right way. From the documentation of getPermissions :
    What I think you want to do is this :
    Code (Text):
    public boolean isAdmin(String name) {
        for (String group : getProxy().getConfigurationAdapter.getGroups(name)) {
            if (getProxy().getConfigurationAdapter.getPermissions(group).contains("ccGeneral.Admin")
                return true;
        }
        return false;
    }
     
     
  3. Ooh...
    I see now.
    Thanks so much for this!
    One other thing, where are you finding said "documentation". Do you mean the Github, or something else?