From fc54b843e4c5736bf416b900db79ea1440cbee96 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Thu, 03 Jun 2021 12:58:20 +0000
Subject: [PATCH] Encoder Tests

---
 src/de/uhilger/httpserver/auth/realm/User.java |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/src/de/uhilger/httpserver/auth/realm/User.java b/src/de/uhilger/httpserver/auth/realm/User.java
index 794d989..c5a4cd4 100644
--- a/src/de/uhilger/httpserver/auth/realm/User.java
+++ b/src/de/uhilger/httpserver/auth/realm/User.java
@@ -25,6 +25,26 @@
 public class User {
   private String name;
   private String password;
+  //private String hash;
+  //private List<String> roles;
+  
+  public User() {
+    //this.roles = new ArrayList();
+  }
+  
+  /*
+  public void addRole(String role) {
+    roles.add(role);
+  }
+  
+  public void revokeRole(String role) {
+    roles.remove(role);
+  }
+  
+  public boolean hasRole(String role) {
+    return roles.contains(role);
+  }
+  */
 
   public String getName() {
     return name;
@@ -34,6 +54,7 @@
     this.name = name;
   }
 
+  
   public String getPassword() {
     return password;
   }
@@ -42,4 +63,29 @@
     this.password = password;
   }
   
+  
+  /*
+  public void setHash(String hash) {
+    this.hash = hash;
+  }
+  
+  public String getHash() {
+    return hash;
+  }
+  */
+
+  @Override
+  public int hashCode() {
+    return this.getName().hashCode();
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if(obj instanceof User) {
+      return this.getName().equals(((User) obj).getName());
+    } else {
+      return false;
+    }
+  }
+  
 }

--
Gitblit v1.9.3