学校のプロジェクト用にセキュリティとログインシステムを備えたJavaプログラムを作成する必要があります
私は、セキュリティレベルのあるJavaのセキュリティロールに列挙型を使用することを考えていました。
public enum Role {
lECTOR(0), COORDINATOR(1), ADMINISTRATOR(2);
private int securityLevel;
Role(int securityLevel) {
this.securityLevel = securityLevel;
}
public int returnSecurityLevel() {
return securityLevel;
}
mysqlでは2つのテーブルを作成することを考えています
table users with a userid, username, password and security_id
roles with a security_id, rolename this table I would link to the enum
次に、セキュリティレベルに応じて、特定のユーザーが実行できることと実行できないことを説明します。
これは仕事をするのに良い方法ですか、そうでないか、どんな提案も大歓迎です。