Correcting RolesPart display in User views

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-10-05 14:45:12 -07:00
parent 3e93c19faa
commit 8ef28802a7
4 changed files with 28 additions and 16 deletions

View File

@@ -104,9 +104,11 @@ namespace Orchard.Users.Controllers {
public ActionResult Edit(int id) {
if (!Services.Authorizer.Authorize(Permissions.ManageUsers, T("Not authorized to manage users")))
return new HttpUnauthorizedResult();
var user = Services.ContentManager.Get<UserPart>(id);
return View(new UserEditViewModel {
User = Services.ContentManager.Get<UserPart>(id)
User = Services.ContentManager.BuildEditorModel(user)
});
}
@@ -114,9 +116,10 @@ namespace Orchard.Users.Controllers {
public ActionResult EditPOST(int id) {
if (!Services.Authorizer.Authorize(Permissions.ManageUsers, T("Not authorized to manage users")))
return new HttpUnauthorizedResult();
var user = Services.ContentManager.Get(id);
var model = new UserEditViewModel {
User = Services.ContentManager.Get<UserPart>(id)
User = Services.ContentManager.UpdateEditorModel(user, this)
};
TryUpdateModel(model);