// Path: authrite-service/src/main/java/com/lewisd/authrite/auth/PasswordDigest.java
// public final class PasswordDigest {
//     private final String digest;
// 
//     private PasswordDigest(final String digest) {
//         this.digest = digest;
//     }
// 
//     public String getDigest() {
//         return digest;
//     }
// 
//     public boolean checkPassword(final String passwordToCheck) {
//         return BCrypt.checkpw(passwordToCheck, digest);
//     }
// 
//     public static PasswordDigest fromDigest(final String digest) {
//         return new PasswordDigest(digest);
//     }
// 
//     public static PasswordDigest generateFromPassword(final int bcryptCost, final String password) {
//         final String salt = BCrypt.gensalt(bcryptCost);
//         return PasswordDigest.fromDigest(BCrypt.hashpw(password, salt));
//     }
// }
// 
// Path: authrite-service/src/main/java/com/lewisd/authrite/auth/Roles.java
// public enum Roles {
//     PLAYER {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     RO_ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return true;
//         }
//     };
// 
//     public String getName() {
//         return name();
//     }
// 
//     public boolean canRead(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canReadUser(principal, resourceId);
//         }
//         return false;
//     }
// 
//     protected abstract boolean canReadUser(User principal, UUID userId);
// 
//     public boolean canWrite(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canWriteUser(principal, resourceId);
//         } else if (resourceClass == Player.class) {
//             // TODO: Implement this
//             return false;
//         }
//         return false;
//     }
// 
//     protected abstract boolean canWriteUser(User principal, UUID userId);
// }


import com.lewisd.authrite.auth.PasswordDigest;
import com.lewisd.authrite.auth.Roles;
import javax.annotation.Nullable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
package com.lewisd.authrite.jdbc.model;



public class DBUser {
    private UUID id;
    private Date createdDate;
    private Date modifiedDate;
    private Date deletedDate;
    private Date lastLoginDate;
    private Date lastPasswordChangeDate;
    private Date emailValidatedDate;
    private String email;
    private String displayName;
// Path: authrite-service/src/main/java/com/lewisd/authrite/auth/PasswordDigest.java
// public final class PasswordDigest {
//     private final String digest;
// 
//     private PasswordDigest(final String digest) {
//         this.digest = digest;
//     }
// 
//     public String getDigest() {
//         return digest;
//     }
// 
//     public boolean checkPassword(final String passwordToCheck) {
//         return BCrypt.checkpw(passwordToCheck, digest);
//     }
// 
//     public static PasswordDigest fromDigest(final String digest) {
//         return new PasswordDigest(digest);
//     }
// 
//     public static PasswordDigest generateFromPassword(final int bcryptCost, final String password) {
//         final String salt = BCrypt.gensalt(bcryptCost);
//         return PasswordDigest.fromDigest(BCrypt.hashpw(password, salt));
//     }
// }
// 
// Path: authrite-service/src/main/java/com/lewisd/authrite/auth/Roles.java
// public enum Roles {
//     PLAYER {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     RO_ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return true;
//         }
//     };
// 
//     public String getName() {
//         return name();
//     }
// 
//     public boolean canRead(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canReadUser(principal, resourceId);
//         }
//         return false;
//     }
// 
//     protected abstract boolean canReadUser(User principal, UUID userId);
// 
//     public boolean canWrite(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canWriteUser(principal, resourceId);
//         } else if (resourceClass == Player.class) {
//             // TODO: Implement this
//             return false;
//         }
//         return false;
//     }
// 
//     protected abstract boolean canWriteUser(User principal, UUID userId);
// }


// Path: authrite-service/src/main/java/com/lewisd/authrite/jdbc/model/DBUser.java
import com.lewisd.authrite.auth.PasswordDigest;
import com.lewisd.authrite.auth.Roles;
import javax.annotation.Nullable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

package com.lewisd.authrite.jdbc.model;



public class DBUser {
    private UUID id;
    private Date createdDate;
    private Date modifiedDate;
    private Date deletedDate;
    private Date lastLoginDate;
    private Date lastPasswordChangeDate;
    private Date emailValidatedDate;
    private String email;
    private String displayName;
    private PasswordDigest passwordDigest;