Ejemplo n.º 1
0
        public void GroupsSeed(ManahostManagerDAL context)
        {
            RoleManager <CustomRole, int> managerGroup = new ClientRoleManager(new CustomRoleStore(context));

            if (managerGroup.FindByName(GenericNames.ADMINISTRATOR) == null)
            {
                managerGroup.Create(new CustomRole(GenericNames.ADMINISTRATOR));
            }
            if (managerGroup.FindByName(GenericNames.REGISTERED_VIP) == null)
            {
                managerGroup.Create(new CustomRole(GenericNames.REGISTERED_VIP));
            }
            if (managerGroup.FindByName(GenericNames.VIP) == null)
            {
                managerGroup.Create(new CustomRole(GenericNames.ADMINISTRATOR));
            }
            if (managerGroup.FindByName(GenericNames.DISABLED) == null)
            {
                managerGroup.Create(new CustomRole(GenericNames.DISABLED));
            }
            if (managerGroup.FindByName(GenericNames.MANAGER) == null)
            {
                managerGroup.Create(new CustomRole(GenericNames.MANAGER));
            }
        }