package enea.lecservice.entities;

public enum PermissionEnum {
    VIEW("view"),
    ADMIN("admin");

    private String name;

    PermissionEnum(String name) {
        this.name = name;
    }

    @Override
    public String toString(){
        return name;
    }

    public static PermissionEnum fromString(String text) {
        for (PermissionEnum role : PermissionEnum.values()) {
            if (role.name.equalsIgnoreCase(text)) {
                return role;
            }
        }
        return null;
    }
}
