mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 12:53:33 +08:00
- Manage Roles Index action,view,model for Roles
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4039480
This commit is contained in:
@@ -1,18 +1,31 @@
|
||||
using System.Web.Mvc;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Data;
|
||||
using Orchard.Notify;
|
||||
using Orchard.Roles.Models;
|
||||
using Orchard.Roles.ViewModels;
|
||||
|
||||
namespace Orchard.Roles.Controllers {
|
||||
[ValidateInput(false)]
|
||||
public class AdminController : Controller {
|
||||
private readonly IRepository<RoleRecord> _roleRepository;
|
||||
private readonly INotifier _notifier;
|
||||
|
||||
public AdminController(INotifier notifier) {
|
||||
public AdminController(IRepository<RoleRecord> roleRepository, INotifier notifier) {
|
||||
_roleRepository = roleRepository;
|
||||
_notifier = notifier;
|
||||
}
|
||||
|
||||
|
||||
public ActionResult Index() {
|
||||
return View();
|
||||
var model = new RolesIndexViewModel {
|
||||
Rows = _roleRepository.Fetch(x => x.Name != null)
|
||||
.Select(x => new RolesIndexViewModel.Row {
|
||||
Role = x
|
||||
})
|
||||
.ToList()
|
||||
};
|
||||
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user