]> SALOME platform Git repositories - modules/gde.git/blobdiff - projects/GDE_App/GDE-ejb/src/java/com/edf/gde/common/PermissionManager.java
Salome HOME
(no commit message)
[modules/gde.git] / projects / GDE_App / GDE-ejb / src / java / com / edf / gde / common / PermissionManager.java
index 94011c89125f244d1b344c84b9270c4122aa7a3b..80b895bdd7a570b7b4aa2a05eec08f782f74662b 100644 (file)
@@ -4,6 +4,8 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
 
 /**
  *
@@ -13,31 +15,18 @@ public class PermissionManager {
     /**
      * MAP<K,V>
      * K = Service name
-     * V = Set of user Id
+     * V = Set of group Id
      */
-    Map<String, Set<Long>> userPermissions;
-
-    public PermissionManager() {
-        userPermissions = new HashMap<>();
+    private EntityManager em;
+    public PermissionManager(EntityManager em) {
+        this.em = em;
     }
     
-    public synchronized void addUser(String serviceName, long userId) {
-        Set<Long> users = userPermissions.get(serviceName);
-        if (users == null) {
-            users = new HashSet<>();
-            users.add(userId);
-            userPermissions.put(serviceName, users);
-        } else {
-            users.add(userId);
-        }
+    public synchronized void addGroup(long groupId, String serviceName, String methodName) {
     }
     
-    public synchronized boolean isValid(String serviceName, long userId) {
-        Set<Long> users = userPermissions.get(serviceName);
-        if (users == null) {
-            return false;
-        }
-        return users.contains(userId);
+    public synchronized boolean checkPermission(long userId, String serviceName, String methodeName) {
+        return false;
     }
     
 }