Skip to content

Commit

Permalink
Fixed major permission issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Mar 29, 2016
1 parent 4f33a22 commit c7690ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
name: AdvancedPortals
version: 0.0.15
version: 0.0.16
author: sekwah41
description: An advanced portals plugin for bukkit.
commands:
Expand Down
8 changes: 7 additions & 1 deletion src/com/sekwah/advancedportals/portals/Portal.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,15 @@ public static boolean activate(Player player, AdvancedPortal portal) {

// add other variables or filter code here, or somehow have a way to register them

// TODO on load and unload recode the permissions to try to register themselves
// https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/PluginManager.html#addPermission(org.bukkit.permissions.Permission)
// check they havent been registered before too and store a list of ones made by this plugin to remove when portals are unloaded.
// When a portal is added or removed it reloads all portals(i think) so add code for unloading too.

String permission = portal.getArg("permission");
/*if((permission == null || (permission != null && player.hasPermission(permission)) || player.isOp())){*/
if (!((permission != null && player.hasPermission(permission)) || player.isOp())) {
// 3 checks, 1st is if it doesnt need perms. 2nd is if it does do they have it. And third is are they op.
if (!(permission == null || (permission != null && player.hasPermission(permission)) || player.isOp())) {
player.sendMessage("\u00A7c[\u00A77AdvancedPortals\u00A7c] You do not have permission to use this portal!");
return false;
}
Expand Down

0 comments on commit c7690ba

Please sign in to comment.