package fr.pandacube.lib.permissions; import fr.pandacube.lib.db.SQLElement; import fr.pandacube.lib.db.SQLField; public class SQLPermissions extends SQLElement { public SQLPermissions() { super(); } public SQLPermissions(int id) { super(id); } @Override protected String tableName() { return "permissions"; } public static final SQLField name = field(VARCHAR(64), false); public static final SQLField type = field(TINYINT, false); public static final SQLField key = field(VARCHAR(256), false); public static final SQLField value = field(VARCHAR(256), false); public static final SQLField server = field(VARCHAR(64), true); public static final SQLField world = field(VARCHAR(64), true); public enum EntityType { User, Group; public int getCode() { return ordinal(); } public static EntityType getByCode(int code) { if (code >= 0 && code < values().length) return values()[code]; return null; } } }