Admin UI Missing Navigation/CSS

Topics: Writing modules
Aug 1, 2012 at 6:11 PM

I'm adding the "Administrator" role to a user, but when I navigate to the dashboard, the navigation menu and css/theme is missing.  I'm just getting the admin index page.

Is there something I need to do differently than what I'm doing below?

  var role = _roleService.GetRoleByName("Administrator");
  if (role != null) 
        _userRolesRepository.Create(new UserRolesPartRecord {Role = role, UserId = user.Id});

Aug 1, 2012 at 8:20 PM
Edited Aug 1, 2012 at 8:24 PM

Looks like it was caused by trying to suppress the  Orchard.UI.Admin.AdminFilter.  Even copying the code to my own custom adminfilter caused the UI & CSS to disappear.  

I guess I need to figure out a different way to redirect to my own login page when this url is accessed rather than just show an unauthorized message. 

Aug 1, 2012 at 9:16 PM

I created my own admin filter, I didn't need to suppress any.  Just make sure to inherit from FilterProvider and IAuthorizationFilterProvider.

Then I redirect the user to my own login page when they are trying to access the admin controller.