mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Raised bukkit perms priority
This commit is contained in:
parent
24a6073488
commit
b41c3709ba
1 changed files with 11 additions and 11 deletions
|
@ -669,7 +669,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
|||
* @return true if permission was found. false if not, or was negated.
|
||||
*/
|
||||
public boolean checkUserPermission(User user, String permission) {
|
||||
PermissionCheckResult result = checkFullUserPermission(user, permission);
|
||||
PermissionCheckResult result = checkFullGMPermission(user, permission, true);
|
||||
if (result.resultType.equals(PermissionCheckResult.Type.EXCEPTION) || result.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -708,6 +708,16 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
|||
return result;
|
||||
}
|
||||
|
||||
if (checkBukkit == true) {
|
||||
// Check Bukkit perms to support plugins which add perms via code (Heroes).
|
||||
final Player player = Bukkit.getPlayer(user.getName());
|
||||
if ((player != null) && (player.hasPermission(targetPermission))) {
|
||||
result.resultType = PermissionCheckResult.Type.FOUND;
|
||||
result.owner = user;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission);
|
||||
if (!resultUser.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||
return resultUser;
|
||||
|
@ -727,16 +737,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
|||
}
|
||||
}
|
||||
|
||||
if (checkBukkit == true) {
|
||||
// Check Bukkit perms to support plugins which add perms via code (Heroes).
|
||||
final Player player = Bukkit.getPlayer(user.getName());
|
||||
if ((player != null) && (player.hasPermission(targetPermission))) {
|
||||
result.resultType = PermissionCheckResult.Type.FOUND;
|
||||
result.owner = user;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// THEN IT RETURNS A NOT FOUND
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue