diff --git a/ClientServerLib/ClientServerLib/CWebservice.cs b/ClientServerLib/ClientServerLib/CWebservice.cs index 9e626de1..5bbfa3a9 100644 --- a/ClientServerLib/ClientServerLib/CWebservice.cs +++ b/ClientServerLib/ClientServerLib/CWebservice.cs @@ -119,6 +119,22 @@ namespace ServerLib SongInfo[] getAllSongs(); #endregion + + #region user management + + [OperationContract] + [WebInvoke(Method = "GET", + ResponseFormat = WebMessageFormat.Json, + UriTemplate = "/getUserRole?profileId={profileId}")] + int getUserRole(int profileId); + + [OperationContract] + [WebInvoke(Method = "GET", + ResponseFormat = WebMessageFormat.Json, + UriTemplate = "/setUserRole?profileId={profileId}&userRole={userRole}")] + void setUserRole(int profileId, int userRole); + + #endregion } class CWebservice : ICWebservice @@ -386,5 +402,25 @@ namespace ServerLib } #endregion + + #region user management + + public int getUserRole(int profileId) + { + return CServer.GetUserRole(profileId); + } + + public void setUserRole(int profileId, int userRole) + { + Guid sessionKey = getSession(); + if (!SessionControl.requestRight(sessionKey, UserRights.EditAllProfiles)) + { + WebOperationContext.Current.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.Forbidden; + return; + } + CServer.SetUserRole(profileId, userRole); + } + + #endregion } } diff --git a/Vocaluxe/Website/index.html b/Vocaluxe/Website/index.html index 54ead8a1..c3a400da 100644 --- a/Vocaluxe/Website/index.html +++ b/Vocaluxe/Website/index.html @@ -83,10 +83,10 @@
Configure options and rights
+Configure user rights