mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-26 06:53:02 +00:00
22 lines
726 B
Java
22 lines
726 B
Java
package com.jaquadro.minecraft.storagedrawers.security;
|
|
|
|
import com.jaquadro.minecraft.storagedrawers.api.security.ISecurityProvider;
|
|
import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.IProtectable;
|
|
import com.mojang.authlib.GameProfile;
|
|
|
|
public class SecurityManager
|
|
{
|
|
private static ISecurityProvider defaultProvider = new DefaultSecurityProvider();
|
|
|
|
public static boolean hasAccess (GameProfile profile, IProtectable target) {
|
|
if (target == null || profile == null)
|
|
return false;
|
|
|
|
ISecurityProvider provider = target.getSecurityProvider();
|
|
if (provider == null)
|
|
provider = defaultProvider;
|
|
|
|
return provider.hasAccess(profile, target);
|
|
}
|
|
}
|