/// <summary>
 /// Checks an individual permission for a user and store front, used by other functions, no direct calls
 /// </summary>
 /// <param name="userProfile"></param>
 /// <param name="storeFront"></param>
 /// <param name="action"></param>
 /// <returns></returns>
 private static bool CheckSinglePermission(UserProfile userProfile, StoreFront storeFront, GStoreAction action)
 {
     if (storeFront == null)
     {
         return false;
     }
     return userProfile.ClientUserRoles.AsQueryable()
         .WhereIsActiveAndIsInScope(storeFront)
         .Any(cur => cur.ClientRole.ClientRoleActions.AsQueryable().WhereIsActive().Where(cra => cra.GStoreActionId == action).Any());
 }
示例#2
0
 /// <summary>
 /// Checks an individual permission for a user and store front, used by other functions, no direct calls
 /// </summary>
 /// <param name="userProfile"></param>
 /// <param name="storeFront"></param>
 /// <param name="action"></param>
 /// <returns></returns>
 private static bool CheckSinglePermission(UserProfile userProfile, StoreFront storeFront, GStoreAction action)
 {
     if (storeFront == null)
     {
         return(false);
     }
     return(userProfile.ClientUserRoles.AsQueryable()
            .WhereIsActiveAndIsInScope(storeFront)
            .Any(cur => cur.ClientRole.ClientRoleActions.AsQueryable().WhereIsActive().Where(cra => cra.GStoreActionId == action).Any()));
 }