From ccefc8d334fa37294bbf26eccc5f4ac5703631e3 Mon Sep 17 00:00:00 2001
From: ulrich <ulrich@uhilger.de>
Date: Wed, 28 Dec 2016 15:26:02 +0000
Subject: [PATCH] Grant Role und Revoke Role auf UserRole Objekt umgestellt

---
 src/java/de/uhilger/um/api/UserMgr.java |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/java/de/uhilger/um/api/UserMgr.java b/src/java/de/uhilger/um/api/UserMgr.java
index cf6982a..6626665 100644
--- a/src/java/de/uhilger/um/api/UserMgr.java
+++ b/src/java/de/uhilger/um/api/UserMgr.java
@@ -116,20 +116,14 @@
     
   /* ------------ Rollen ------------------ */
   
-  public UserRole grantRole(String userId, String roleName) {
-    UserRole ur = new UserRole();
-    ur.setRole(roleName);
-    ur.setUser(userId);
-    getDb().insert(ur, UserRoleMapper);
-    return ur;
+  public UserRole grantRole(UserRole role) {
+    getDb().insert(role, UserRoleMapper);
+    return role;
   }
   
-  public UserRole revokeRole(String userId, String roleName) {
-    UserRole ur = new UserRole();
-    ur.setRole(roleName);
-    ur.setUser(userId);
-    getDb().delete(ur, UserRoleMapper);
-    return ur;
+  public UserRole revokeRole(UserRole role) {
+    getDb().delete(role, UserRoleMapper);
+    return role;
   }
   
   public List getRoleNamesGranted() {

--
Gitblit v1.9.3