public string[] GetAllRoles()
 {
     try
     {
         return _roleProvider.GetAllRoles();
     }
     catch (Exception ex)
     {
         Logger.Error("Error : ProfileService.GetAllRoles - {0}", ex.Message);
         return new string[0];
     }
 }
Esempio n. 2
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            var currentUser = HttpContext.Current.User;
            var roleList    = _roleProvider.GetAllRoles();

            if (currentUser != null)
            {
                foreach (var role in roleList)
                {
                    if (currentUser.IsInRole(role.Rolename))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            return(false);
        }
Esempio n. 3
0
 public override string[] GetAllRoles()
 {
     return(RoleProvider.GetAllRoles());
 }
 public void TestNewProviderHasJustAdminRole()
 {
     Assert.AreEqual("Administrator", _provider.GetAllRoles().Single());
 }
Esempio n. 5
0
 public List <RoleDetails> GetAllRoles()
 {
     return(_iRoleProvider.GetAllRoles());
 }
Esempio n. 6
0
        public PartialViewResult AllRoles()
        {
            var roleList = _roleProvider.GetAllRoles();

            return(PartialView(roleList));
        }