本文整理汇总了C#中IAuthenticationContext.CheckPermission方法的典型用法代码示例。如果您正苦于以下问题:C# IAuthenticationContext.CheckPermission方法的具体用法?C# IAuthenticationContext.CheckPermission怎么用?C# IAuthenticationContext.CheckPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAuthenticationContext
的用法示例。
在下文中一共展示了IAuthenticationContext.CheckPermission方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TaxesMainSettingsViewModel
public TaxesMainSettingsViewModel(
ITaxCategorySettingsViewModel taxCategorySettingsViewModel,
ITaxSettingsViewModel taxSettingsViewModel,
IViewModelsFactory<IJurisdictionSettingsViewModel> jSettingsVmFactory,
IViewModelsFactory<IJurisdictionGroupSettingsViewModel> jGroupVmFactory,
IViewModelsFactory<ITaxImportHomeViewModel> importVmFactory,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxCategories))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Tax categories", Category = NavigationNames.ModuleName, ViewModel = taxCategorySettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdiction))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdictions", Category = NavigationNames.ModuleName, ViewModel = jSettingsVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Taxes)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdictionGroups))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdiction groups", Category = NavigationNames.ModuleName, ViewModel = jGroupVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Taxes)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxes))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Taxes", Category = NavigationNames.ModuleName, ViewModel = taxSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsTaxImport))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = Configuration.NavigationNames.HomeName, Caption = "Import", Category = NavigationNames.ModuleName, ViewModel = importVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("parentViewModel", this)) });
}
CurrentTab = SubItems[0];
}
示例2: AppConfigMainSettingsViewModel
public AppConfigMainSettingsViewModel(IAppConfigSettingsViewModel appConfigSetting, ISystemJobsViewModel systemJobSetting, IEmailTemplatesViewModel emailTemplates, IDisplayTemplatesViewModel displayTemplates, ILocalizationMainViewModel localizationHome, ICacheViewModel cacheViewModel, IAuthenticationContext authContext)
{
var items = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigSettings))
{
items.Add(new ItemTypeHomeTab { Caption = "Settings", Category = NavigationNames.ModuleName, ViewModel = appConfigSetting });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigSystemJobs))
{
items.Add(new ItemTypeHomeTab { Caption = "System jobs", Category = NavigationNames.ModuleName, ViewModel = systemJobSetting });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigEmailTemplates))
{
items.Add(new ItemTypeHomeTab { Caption = "Email templates", Category = NavigationNames.ModuleName, ViewModel = emailTemplates });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigDisplayTemplates))
{
items.Add(new ItemTypeHomeTab { Caption = "Display templates", Category = NavigationNames.ModuleName, ViewModel = displayTemplates });
}
items.Add(new ItemTypeHomeTab { Caption = "Localization", Category = NavigationNames.ModuleName, ViewModel = localizationHome });
if (authContext.CheckPermission(PredefinedPermissions.SettingsAppConfigSettings))
{
items.Add(new ItemTypeHomeTab { Caption = "Cache", Category = NavigationNames.ModuleName, ViewModel = cacheViewModel });
}
SubItems = items;
if (SubItems.Count > 0)
{
CurrentTab = SubItems[0];
}
}
示例3: ShippingMainSettingsViewModel
public ShippingMainSettingsViewModel(
IShippingOptionSettingsViewModel shippingOptionSettingsViewModel,
IShippingMethodSettingsViewModel shippingMethodSettingsViewModel,
IShippingPackageSettingsViewModel shippingPackageSettingsViewModel,
IViewModelsFactory<IJurisdictionSettingsViewModel> jurisdictionSettingsVmFactory,
IViewModelsFactory<IJurisdictionGroupSettingsViewModel> jGroupVmFactory,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingOptions))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping options", ViewModel = shippingOptionSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingMethods))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping methods", ViewModel = shippingMethodSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsShippingPackages))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Shipping packages", ViewModel = shippingPackageSettingsViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdiction))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdictions", ViewModel = jurisdictionSettingsVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Shipping)) });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsJurisdictionGroups))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Jurisdiction groups", ViewModel = jGroupVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("jurisdictionType", JurisdictionTypes.Shipping)) });
}
CurrentTab = SubItems[0];
}
示例4: LocalizationMainViewModel
public LocalizationMainViewModel(ILocalizationHomeViewModel homeViewModel, IViewModelsFactory<ILocalizationImportJobHomeViewModel> importVmFactory, IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase() { Title = "Localization", SubTitle = "SETTINGS" };
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.Name_SettingsAppConfigSettings))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeName, Caption = "Localizations", ViewModel = homeViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.Name_SettingsAppConfigSettings))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = Configuration.NavigationNames.HomeName, Caption = "Import", ViewModel = importVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("parentViewModel", this)) });
}
if (SubItems.Count > 0)
CurrentTab = SubItems[0];
}
示例5: CaseCommunicationControlViewModel
public CaseCommunicationControlViewModel(IAssetService assetService, IViewModelsFactory<IKnowledgeBaseDialogViewModel> knowledgeBaseGroupVmFactory, IAuthenticationContext authContext, string authorId, string authorName, CustomersDetailViewModel parentViewModel)
: base(assetService, knowledgeBaseGroupVmFactory, authorId, authorName)
{
_parentViewModel = parentViewModel;
_authContext = authContext;
CommonConfirmRequest = new InteractionRequest<Confirmation>();
IsReadOnly = !_authContext.CheckPermission(PredefinedPermissions.CustomersAddCaseComments);
DefToolBarCommands();
}
示例6: MainPriceListViewModel
public MainPriceListViewModel(IPriceListHomeViewModel priceListHomeViewModel, IPriceListAssignmentHomeViewModel priceListAssignmentHomeViewModel, IViewModelsFactory<IPricelistImportJobHomeViewModel> pricelistImportVmFactory, IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase() { Title = "Price Lists", SubTitle = "MERCHANDISE MANAGEMENT" };
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.PricingPrice_ListsManage))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNamePriceList, Caption = "Price Lists", ViewModel = priceListHomeViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.PricingPrice_List_AssignmentsManage))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNamePriceListAssignment, Caption = "Price List assignments", ViewModel = priceListAssignmentHomeViewModel });
}
if (authContext.CheckPermission(PredefinedPermissions.PricingPrice_ListsImport_Jobs) ||
authContext.CheckPermission(PredefinedPermissions.PricingPrice_ListsImport_JobsRun))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNamePriceList, Caption = "Import", ViewModel = pricelistImportVmFactory.GetViewModelInstance(new KeyValuePair<string, object>("parentViewModel", this)) });
}
CurrentTab = SubItems[0];
}
示例7: CatalogMainViewModel
public CatalogMainViewModel(
IViewModelsFactory<ICatalogHomeViewModel> catalogHomeVmFactory,
IViewModelsFactory<ICatalogImportJobHomeViewModel> importVmFactory,
IReviewsHomeViewModel reviewsHomeViewModel,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
var parameters = new KeyValuePair<string, object>("parentViewModel", this);
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeName, Caption = "Catalog", Category = NavigationNames.ModuleName, ViewModel = catalogHomeVmFactory.GetViewModelInstance(parameters) });
if (authContext.CheckPermission(PredefinedPermissions.CatalogCatalog_Import_JobsManage) ||
authContext.CheckPermission(PredefinedPermissions.CatalogCatalog_Import_JobsRun))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeName, Caption = "Import", Category = NavigationNames.ModuleName, ViewModel = importVmFactory.GetViewModelInstance(parameters) });
}
if (authContext.CheckPermission(PredefinedPermissions.CatalogCustomerReviewsManage))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNameReviews, Caption = "Reviews", Category = NavigationNames.ModuleName, ViewModel = reviewsHomeViewModel });
}
CurrentTab = SubItems[0];
}
示例8: SecurityMainViewModel
public SecurityMainViewModel(IViewModelsFactory<IAccountHomeViewModel> accountVmFactory, IViewModelsFactory<IRoleHomeViewModel> roleVmFactory, IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase
{
Title = "Users",
SubTitle = "USER MANAGMENT"
};
SubItems = new List<ItemTypeHomeTab>();
var parameters = new KeyValuePair<string, object>("parentViewModel", this);
if (authContext.CheckPermission(PredefinedPermissions.SecurityAccounts))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Accounts", ViewModel = accountVmFactory.GetViewModelInstance(parameters) });
}
if (authContext.CheckPermission(PredefinedPermissions.SecurityRoles))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Roles", ViewModel = roleVmFactory.GetViewModelInstance(parameters) });
}
CurrentTab = SubItems[0];
}
示例9: CustomersMainSettingsViewModel
public CustomersMainSettingsViewModel(
ICaseRulesSettingsViewModel caseRulesSettingsViewModel,
ICasePropertySetsSettingsViewModel casePropertySetsSettingsViewModel,
ICaseTemplatesSettingsViewModel caseTemplatesSettingsViewModel,
IAuthenticationContext authContext)
{
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.SettingsCustomerRules))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Rules", Category = NavigationNames.ModuleName, ViewModel = caseRulesSettingsViewModel, Order = 1 });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsCustomerInfo))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Info", Category = NavigationNames.ModuleName, ViewModel = casePropertySetsSettingsViewModel, Order = 2 });
}
if (authContext.CheckPermission(PredefinedPermissions.SettingsCustomerCaseTypes))
{
SubItems.Add(new ItemTypeHomeTab { Caption = "Case types", Category = NavigationNames.ModuleName, ViewModel = caseTemplatesSettingsViewModel, Order = 3 });
}
CurrentTab = SubItems[0];
}
示例10: MainMarketingViewModel
public MainMarketingViewModel(IMarketingHomeViewModel marketingVm, IDynamicContentHomeViewModel contentVm, IContentPublishingHomeViewModel publishingVm, IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase
{
Title="Marketing",
SubTitle="MARKETING SERVICE"
};
SubItems = new List<ItemTypeHomeTab>();
if (authContext.CheckPermission(PredefinedPermissions.MarketingPromotionsManage))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeName, Caption = "Promotions", ViewModel = marketingVm });
}
if (authContext.CheckPermission(PredefinedPermissions.MarketingDynamic_ContentManage))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNameDynamicContent, Caption = "Dynamic content", Order = 10, ViewModel = contentVm });
}
if (authContext.CheckPermission(PredefinedPermissions.MarketingContent_PublishingManage))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNameContentPublishing, Caption = "Content publishing", Order = 20, ViewModel = publishingVm });
}
CurrentTab = SubItems[0];
}
示例11: CustomersMainViewModel
public CustomersMainViewModel(ICustomersHomeViewModel customersHomeViewModel, ISearchHomeViewModel searchHomeViewModel, IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase() { Title = "Cases", SubTitle = "CUSTOMER SERVICE" };
SubItems = new List<ItemTypeHomeTab>
{
new ItemTypeHomeTab
{
IdTab = NavigationNames.HomeName,
Caption = "Cases",
ViewModel = customersHomeViewModel
}
};
if (authContext.CheckPermission(PredefinedPermissions.CustomersSearchCases))
{
SubItems.Add(new ItemTypeHomeTab { IdTab = NavigationNames.HomeNameSearch, Caption = "Search", ViewModel = searchHomeViewModel });
}
CurrentTab = SubItems[0];
}