public virtual ActionResult Methods(DataSourceRequest command) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods)) { return(AccessDeniedKendoGridJson()); } var methodsModel = new List <AuthenticationMethodModel>(); var methods = _openAuthenticationService.LoadAllExternalAuthenticationMethods(); foreach (var method in methods) { var tmp1 = method.ToModel(); tmp1.IsActive = method.IsMethodActive(_externalAuthenticationSettings); methodsModel.Add(tmp1); } methodsModel = methodsModel.ToList(); var gridModel = new DataSourceResult { Data = methodsModel, Total = methodsModel.Count }; return(Json(gridModel)); }
public ActionResult Methods(GridCommand command) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods)) { return(AccessDeniedView()); } var methodsModel = new List <AuthenticationMethodModel>(); var methods = _openAuthenticationService.LoadAllExternalAuthenticationMethods(); foreach (var method in methods) { var tmp1 = method.ToModel(); tmp1.IsActive = method.IsMethodActive(_externalAuthenticationSettings); methodsModel.Add(tmp1); } methodsModel = methodsModel.ForCommand(command).ToList(); var gridModel = new GridModel <AuthenticationMethodModel> { Data = methodsModel, Total = methodsModel.Count() }; return(new JsonResult { Data = gridModel }); }
public ActionResult Providers() { var methodsModel = new List <AuthenticationMethodModel>(); var methods = _openAuthenticationService.LoadAllExternalAuthenticationMethods(); foreach (var method in methods) { var model = _pluginMediator.ToProviderModel <IExternalAuthenticationMethod, AuthenticationMethodModel>(method); model.IsActive = method.IsMethodActive(_externalAuthenticationSettings); methodsModel.Add(model); } return(View(methodsModel)); }
public ActionResult Providers() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods)) { return(AccessDeniedView()); } var methodsModel = new List <AuthenticationMethodModel>(); var methods = _openAuthenticationService.LoadAllExternalAuthenticationMethods(); foreach (var method in methods) { var model = _pluginMediator.ToProviderModel <IExternalAuthenticationMethod, AuthenticationMethodModel>(method); model.IsActive = method.IsMethodActive(_externalAuthenticationSettings); methodsModel.Add(model); } return(View(methodsModel)); }
/// <summary> /// Load all external authentication methods /// </summary> /// <param name="customer">Load records allowed only to a specified customer; pass null to ignore ACL permissions</param> /// <param name="storeId">Load records allowed only in a specified store; pass 0 to load all records</param> /// <returns>External authentication methods</returns> public IList <IExternalAuthenticationMethod> LoadAllExternalAuthenticationMethods(Customer customer = null, int storeId = 0) { return(_openAuthenticationService.LoadAllExternalAuthenticationMethods(customer, storeId)); }