com.kuzi117.PermGUI
Class GUIPermissions

java.lang.Object
  extended by com.kuzi117.PermGUI.GUIPermissions

public class GUIPermissions
extends java.lang.Object


Method Summary
 boolean addPermissionsOrdered(java.lang.String pluginName, java.util.List<java.lang.String> permissionsToAdd, java.util.List<java.lang.String> descriptionsToAdd)
          Adds permissions for your plugin in an orderly fashion.
 boolean addPermissionsUnordered(java.lang.String pluginName, java.util.HashMap<java.lang.String,java.lang.String> permissionsToAdd)
          Adds permissions in an order that is NOT guaranteed.
 boolean removePermissions(java.lang.String pluginName, java.util.Set<java.lang.String> permissionsToRemove)
          Removes permissions for your plugin.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addPermissionsUnordered

public boolean addPermissionsUnordered(java.lang.String pluginName,
                                       java.util.HashMap<java.lang.String,java.lang.String> permissionsToAdd)
Adds permissions in an order that is NOT guaranteed.

Used when the permissions for a plugin do not need to maintain a specific order when being added to the GUI. This does not mean that the permissions will not be in the order they are added just that the order cannot be and is not guaranteed.
Multiple attempts to add will be ignored unless removePermissions(java.lang.String, java.util.Set) is used first.

Parameters:
pluginName - Name of plugin that is adding permissions. Use toString() here. Used to register a plugin.
permissionsToAdd - HashMap of permissions. The key is a permission in the form "plugin.category.etc". The value is the description of the permission.
Returns:
Returns true if permissions added. Returns false if adding permissions denied (if permissions already added).

addPermissionsOrdered

public boolean addPermissionsOrdered(java.lang.String pluginName,
                                     java.util.List<java.lang.String> permissionsToAdd,
                                     java.util.List<java.lang.String> descriptionsToAdd)
Adds permissions for your plugin in an orderly fashion.

Multiple attempts to add will be ignored unless removePermissions(java.lang.String, java.util.Set) is used first.
It should also be noted that if you declare less descriptions than permissions, or vice versa, then an appropriate message will be appended to the end of the smaller list until their sizes are equal.

Parameters:
pluginName - Name of plugin that is adding permissions. Use toString() here. Used to register a plugin.
permissionsToAdd - List of permissions in order the order they should be added to the GUI.
descriptionsToAdd - List of descriptions in an order that correlates to the order of permissions in permissionsToAdd.
Returns:
Returns true if permissions added. Returns false if adding permissions denied (if permissions already added).

removePermissions

public boolean removePermissions(java.lang.String pluginName,
                                 java.util.Set<java.lang.String> permissionsToRemove)
Removes permissions for your plugin.
NOTE: Calling this method will not remove permissions for an already open GUI, it only removes for future creations. Multiple attempts to remove will be ignored unless addPermissionsOrdered(java.lang.String, java.util.List, java.util.List) or addPermissionsUnordered(java.lang.String, java.util.HashMap) is used first.
Ensure that when removing that all of the permissions from your plugin are removed.
No specific order is required when removing.

Parameters:
pluginName - Name of plugin that is removing permissions. Use toString() here.
permissionsToRemove - Set of permissions to remove from the GUI.
Returns:
Returns true if permissions removed. Returns false if removing permissions denied (if permissions already removed or never added). Returns false if at least one of the requested permissions was not registered.