Advertisement
Drakia

Untitled

Mar 9th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. /*
  2. * Check a deep permission, this will check to see if the permissions is defined for this use
  3. * If using Permissions it will return the same as hasPerm
  4. * If using SuperPerms will return true if the node isn't defined
  5. * Or the value of the node if it is
  6. */
  7. public static boolean hasPermDeep(Player player, String perm) {
  8. if (permissions != null) {
  9. if (permDebug)
  10. Stargate.debug("hasPermDeep::Permissions", perm + " => " + permissions.getHandler().has(player, perm));
  11. return permissions.getHandler().has(player, perm);
  12. } else {
  13. if (!player.isPermissionSet(perm)) {
  14. if (permDebug)
  15. Stargate.debug("hasPermDeep::SuperPerm", perm + " => true");
  16. return true;
  17. }
  18. if (permDebug)
  19. Stargate.debug("hasPermDeep::SuperPerms", perm + " => " + player.hasPermission(perm));
  20. return player.hasPermission(perm);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement