Exemplo n.º 1
0
 public static List<CMediaResource> sFilterMediaByUser(List<CMediaResource> List, CSystemUser User)
 {
     List<CMediaResource> R = new List<CMediaResource>();
     foreach (CMediaResource Object in List)
     {
         var Rights = User.GetRightsForMetaobject(Object);
         if (Rights > 0)
         {
             if (Object.Status == EnMetaobjectStatus.EDisabled || Object.Status == EnMetaobjectStatus.EBanned)
                 continue;
             Object.Children = sFilterObjectsByUser(Object.Children, User);
             R.Add(Object);
         }
     }
     return R;
 }
Exemplo n.º 2
0
 public static List<CMetaobject> sFilterObjectsByUser(List<CMetaobject> List, CSystemUser User, bool FilterByStatus = true)
 {
     List<CMetaobject> R = new List<CMetaobject>();
     foreach (CMetaobject Object in List)
     {
         var Rights = User.GetRightsForMetaobject(Object);
         if (Rights > 0)
         {
             if (FilterByStatus && (Object.Status == EnMetaobjectStatus.EDisabled || Object.Status == EnMetaobjectStatus.EBanned))
                 continue;
             Object.Children = sFilterObjectsByUser(Object.Children, User, FilterByStatus);
             R.Add(Object);
         }
     }
     return R;
 }