本文整理汇总了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;
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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)));
}
示例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));
}