From ecccfcd9f42501496ad7e5444ef9098f28a19b40 Mon Sep 17 00:00:00 2001
From: ulrich <not disclosed>
Date: Sun, 15 Jan 2017 12:08:00 +0000
Subject: [PATCH] Readme hinzugefĆ¼gt

---
 web/ui/ui.js |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/web/ui/ui.js b/web/ui/ui.js
index 5da03e6..0e7b427 100644
--- a/web/ui/ui.js
+++ b/web/ui/ui.js
@@ -186,7 +186,6 @@
   return roleId;
 }
 
-// {"List":[{"List":[{"String":"ROLE_NAME"},{"String":"testrolle1"}]}]}
 function um_show_user_role_list(resp) {
   $("#nutzerrollen").empty();
   var rollen = resp.List[0];
@@ -195,6 +194,7 @@
     $("#nutzerrollen").append('<option value=' + rolle.String + '>' + rolle.String + '</option>');
   }
   $('#nutzerRolleEntziehen').prop( "disabled", true );
+  $('#rolleErteilen').prop( "disabled", true );
 }
 
 function um_show_role_list(resp) {
@@ -204,7 +204,6 @@
     var rolle = rollen.List[i];
     $("#rollen").append('<option value=' + rolle.String + '>' + rolle.String + '</option>');
   }
-  //$('#neueRolle').prop( "disabled", true );
   $('#rolleErteilen').prop( "disabled", true );
 }
 
@@ -221,7 +220,6 @@
     type: "POST",
     dataType : "html",
     success: function( resp ) {
-      //$('#fehler').html('Antwort: ' + resp);
       um_apicall_get_user_list();
       um_back_from_new_user();
     },
@@ -275,15 +273,15 @@
   });      
 }
 
-// public UserRole grantRole(String userId, String roleName) 
+// http]://example.com/um/api?c=de.uhilger.um.api.UserMgr&m=testmethode
 function um_apicall_grant_role(userId, roleName, isNewRole) {
+  var ur = new UserRole(userId, roleName);
   var m = 'grantRole';
   var u = '../svc/' + m;
   $.ajax({
     url: u,
     data: {
-      p1: userId,
-      p2: roleName
+      p: self.serialisieren(ur)
     },
     type: "POST",
     dataType : "html",
@@ -303,13 +301,13 @@
 }
 
 function um_apicall_revoke_role(userId, roleName) {
+  var ur = new UserRole(userId, roleName);
   var m = 'revokeRole';
   var u = '../svc/' + m;
   $.ajax({
     url: u,
     data: {
-      p1: userId,
-      p2: roleName
+      p: self.serialisieren(ur)
     },
     type: "POST",
     dataType : "html",
@@ -325,7 +323,6 @@
   });
 }
 
-//public List getUserRoleNames(String userId)
 function um_apicall_get_user_roles(userId) {
   var m = 'getUserRoleNames';
   var u = '../svc/' + m + '?p=' + userId;
@@ -334,7 +331,6 @@
     type: "GET",
     dataType : "json",
     success: function( resp ) {
-      // Antwort in Liste anzeigen
       um_show_user_role_list(resp);
     },
     error: function( xhr, status, errorThrown ) {
@@ -354,7 +350,6 @@
     type: "GET",
     dataType : "json",
     success: function( resp ) {
-      // Antwort in Liste anzeigen
       um_show_role_list(resp);
     },
     error: function( xhr, status, errorThrown ) {
@@ -380,4 +375,9 @@
   this.firstName = fn;
   this.lastName = ln;
   this.email = em;
+}
+
+function UserRole(u, r) {
+  this.userId = u;
+  this.role = r;
 }
\ No newline at end of file

--
Gitblit v1.9.3