diff --git a/Bootstrap.Admin/Controllers/Api/UsersController.cs b/Bootstrap.Admin/Controllers/Api/UsersController.cs index b7477cf8..7f67c7d8 100644 --- a/Bootstrap.Admin/Controllers/Api/UsersController.cs +++ b/Bootstrap.Admin/Controllers/Api/UsersController.cs @@ -33,16 +33,13 @@ namespace Bootstrap.Admin.Controllers.Api [HttpPut] public bool Put([FromBody]User value) { + if (User.IsInRole("Administrators")) return false; + + var ret = false; if (value.UserStatus == 3) { return UserHelper.SaveUserCssByName(value.UserName, value.Css); } - if (value.UserStatus == 9) - { - // vlaidate userName - return BootstrapUser.RetrieveUserByUserName(value.UserName) == null && !UserHelper.RetrieveNewUsers().Any(u => u.UserName == value.UserName); - } - var ret = false; if (value.UserName.Equals(User.Identity.Name, System.StringComparison.OrdinalIgnoreCase)) { if (value.UserStatus == 1) diff --git a/Bootstrap.Admin/Views/Admin/Profiles.cshtml b/Bootstrap.Admin/Views/Admin/Profiles.cshtml index 043691c0..54fb45d6 100644 --- a/Bootstrap.Admin/Views/Admin/Profiles.cshtml +++ b/Bootstrap.Admin/Views/Admin/Profiles.cshtml @@ -44,8 +44,8 @@ - @@ -54,7 +54,7 @@
-
+
@@ -70,8 +70,8 @@
-
@@ -99,8 +99,8 @@ - diff --git a/Bootstrap.Admin/wwwroot/js/Profiles.js b/Bootstrap.Admin/wwwroot/js/Profiles.js index 54029bf9..bce3a05e 100644 --- a/Bootstrap.Admin/wwwroot/js/Profiles.js +++ b/Bootstrap.Admin/wwwroot/js/Profiles.js @@ -38,6 +38,7 @@ $('button[data-method]').on('click', function (e) { var $this = $(this); + if ($this.parent().attr("data-admin") === "True") return false; var data = bsa.dataEntity.get(); switch ($this.attr('data-method')) { case 'password': @@ -61,5 +62,5 @@ break; } }); - $('button[data-admin="False"]').removeAttr('disabled'); + $('button[data-admin="False"]').removeClass('d-none'); }); \ No newline at end of file