public Privilege(MasterEnum master, int masterValue, AccessEnum access, int accessValue) { Master = master.ToString(); MasterValue = masterValue; Access = access.ToString(); AccessValue = accessValue; }
public InterfaceGenerator(AccessEnum access, string typeText, IMethodSignatureGenerator methodSigGenerator, IPropertyGenerator propertyGenerator) { Access = access; TypeText = typeText; _methodSignatureGenerator = methodSigGenerator as MethodSignatureGenerator; _propertyGenerator = propertyGenerator as PropertyGenerator; }
public string GenerateTest(Test test, string path, AccessEnum access) { var stringBuilder = new StringBuilder(); Access = access; var statementList = test.StatementList; stringBuilder = _methodGenerator.Generate(statementList, stringBuilder); return stringBuilder.ToString(); }
/*****************************************/ /* helper APIs for the Admin Controller */ /*****************************************/ private bool HasAccessLevel(AccessEnum accessLevel) { if (User?.IsAuthenticated() == null || !(bool)User?.IsAuthenticated()) { return(false); } var identityUser = _users.FindByIdAsync(User.Identity.GetSubjectId(), new CancellationToken()).Result; var coreUser = _readOnlyRepository.GetById <CoreUser, Guid>(Guid.Parse(identityUser.Id)); return(coreUser.Access >= accessLevel); }
public GroupPermissionEntry(AccessEnum access, Group group) : base(access) { _group = group; }
public UserPermissionEntry(AccessEnum access, User user) : base(access) { _user = user; }
public PermissionEntry(AccessEnum access) { _access = access; }
/// <summary> /// 获取AccessValue的列表 /// </summary> /// <param name="query"></param> /// <param name="master">主体对象类型(角色或者用户)</param> /// <param name="access">领域对象(菜单或者按钮)</param> /// <param name="masterValues">主体对象Id</param> /// <returns></returns> public static List <int> GetAccessValueList(this IQueryable <Privilege> query, MasterEnum master, AccessEnum access, params int [] masterValues) { return(Get(query, master, access, masterValues).Select(s => s.AccessValue).ToList()); }
void HasGlobalAccess([In][Out] ref AccessEnum accessEnum) { //TODO I know this is possible but not enough about attributes at the moment to make this work }
public PropertyGenerator(AccessEnum access, string propertyText) { Access = access; PropertyText = propertyText; }
public MetaPermissionEntry(AccessEnum access, string id) : base(access) { _id = id; }
public ExternUserPermissionEntry(AccessEnum access, string externalUserId) : base(access) { _externalUserId = externalUserId; }
public MethodSignatureGenerator(AccessEnum access, string methodText) { Access = access; MethodText = methodText; }
public ExternGroupPermissionEntry(AccessEnum access, string externalGroupId) : base(access) { _externalGroupId = externalGroupId; }
/// <summary> /// 根据权限对象(Master)及功能对象(Access)获取Privilege的列表 /// </summary> /// <param name="query"></param> /// <param name="master">主体对象类型(角色或者用户)</param> /// <param name="access">领域对象(菜单或者按钮)</param> /// <param name="masterValues">主体对象Id</param> /// <returns></returns> public static IQueryable <Privilege> Get(this IQueryable <Privilege> query, MasterEnum master, AccessEnum access, params int[] masterValues) { return(query.Where(x => x.Master == master.ToString() && x.Access == access.ToString() && masterValues.Contains(x.MasterValue))); }
/// <summary> /// Generates an authorization URL based on the requestToken , requiredAccess and requiredPermissions /// </summary> public static string GetAuthorizationURL(Token requestToken, AccessEnum requiredAccess, PermissionsEnum requiredPermissions) { return(string.Format("{0}?oauth_token={1}&Access={2}&Permissions={3}", authorizationUrl, requestToken.id, requiredAccess, requiredPermissions)); }