当前位置: 首页>>代码示例>>C#>>正文


C# RoleType.Contains方法代码示例

本文整理汇总了C#中RoleType.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# RoleType.Contains方法的具体用法?C# RoleType.Contains怎么用?C# RoleType.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoleType的用法示例。


在下文中一共展示了RoleType.Contains方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddOrderDocument

		public DocumentUserType AddOrderDocument(int orderId, Guid fileId, int documentType, string documentDescription)
		{
			var appraiserRoles = new RoleType[] { RoleType.Appraiser, RoleType.CompanyAdminAndAppraiser, RoleType.AppraisalCompanyAdmin };
			var user = _securityContext.CurrentUser;
			DocumentUserType userType;
			if (appraiserRoles.Contains(user.PrimaryRole.RoleType) || documentType == (int)DocumentType.AppraisalReportPDF || documentType == (int)DocumentType.AppraisalReportReviewPDF ||
				documentType == (int)DocumentType.ACIXML)
				userType = DocumentUserType.Appraisal;
			else userType = DocumentUserType.Lender;

			_orderHistoryManager.AddDocumentUploadedNote(orderId, documentType, documentDescription);

			OrderDocumentInfo orderDocumentInfo = new OrderDocumentInfo() { DocumentDescription = documentDescription, DocumentTypeId = documentType, FileId = fileId, UserType = userType, OrderId = orderId };

			_orderDocumentsRepository.Add(orderDocumentInfo);

			return userType;
		}
开发者ID:evkap,项目名称:DVS,代码行数:18,代码来源:OrderDocumentsService.cs

示例2: UserAuthorizedToAccessEnvironment

 private bool UserAuthorizedToAccessEnvironment(UnitOfWork unitOfWork, long userId, string environment,
     RoleType[] roleTypes)
 {
     return
         unitOfWork.Context.Environments.Any(
             x =>
                 x.EnvironmentName == environment &&
                 x.Suite.SuiteUsers.Any(y => y.UserId == userId && roleTypes.Contains((RoleType) y.Role.RoleId)));
 }
开发者ID:punitganshani,项目名称:KonfDB,代码行数:9,代码来源:ConfigurationDataStore.cs

示例3: UserAuthorizedToAccessParameter

 private bool UserAuthorizedToAccessParameter(UnitOfWork unitOfWork, long userId, string parameter,
     RoleType[] roleTypes)
 {
     return
         unitOfWork.Context.Parameters.Any(
             x =>
                 x.ParameterName == parameter &&
                 x.Suite.SuiteUsers.Any(y => y.UserId == userId && roleTypes.Contains((RoleType) y.Role.RoleId)));
 }
开发者ID:punitganshani,项目名称:KonfDB,代码行数:9,代码来源:ConfigurationDataStore.cs

示例4: UserAuthorizedToAccessServer

 private bool UserAuthorizedToAccessServer(UnitOfWork unitOfWork, long userId, long serverId,
     RoleType[] roleTypes)
 {
     return
         unitOfWork.Context.Servers.Any(
             x =>
                 x.ServerId == serverId &&
                 x.Suite.SuiteUsers.Any(y => y.UserId == userId && roleTypes.Contains((RoleType) y.Role.RoleId)));
 }
开发者ID:punitganshani,项目名称:KonfDB,代码行数:9,代码来源:ConfigurationDataStore.cs

示例5: UserAuthorizedToAccessRegion

 private bool UserAuthorizedToAccessRegion(UnitOfWork unitOfWork, long userId, string region,
     RoleType[] roleTypes)
 {
     return
         unitOfWork.Context.Regions.Any(
             x =>
                 x.RegionName == region &&
                 x.Suite.SuiteUsers.Any(y => y.UserId == userId && roleTypes.Contains((RoleType) y.Role.RoleId)));
 }
开发者ID:punitganshani,项目名称:KonfDB,代码行数:9,代码来源:ConfigurationDataStore.cs

示例6: UserAuthorizedToAccessApplication

 public bool UserAuthorizedToAccessApplication(UnitOfWork unitOfWork, long userId, string applicationName,
     RoleType[] roleTypes)
 {
     return
         unitOfWork.Context.Applications.Any(
             x =>
                 x.ApplicationName == applicationName &&
                 x.Suite.SuiteUsers.Any(y => y.UserId == userId && roleTypes.Contains((RoleType) y.Role.RoleId)));
 }
开发者ID:punitganshani,项目名称:KonfDB,代码行数:9,代码来源:ConfigurationDataStore.cs

示例7: UserAuthorizedToAccessSuite

 private bool UserAuthorizedToAccessSuite(UnitOfWork unitOfWork, long loggedInUserId, string suiteName,
     RoleType[] roleTypes)
 {
     return
         unitOfWork.Context.SuiteUsers.Any(
             x =>
                 x.UserId == loggedInUserId && x.Suite.SuiteName == suiteName &&
                 roleTypes.Contains((RoleType) x.Role.RoleId));
 }
开发者ID:punitganshani,项目名称:KonfDB,代码行数:9,代码来源:ConfigurationDataStore.cs


注:本文中的RoleType.Contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。