예제 #1
0
 /// <summary>
 /// Checks to see if a view is visible to a given user
 /// </summary>
 public bool isVisible(CswNbtView View, ICswNbtUser User, bool IncludeEmptyViews, bool SearchableOnly, bool ForEdit = false)
 {
     return(((View.Root.ChildRelationships.Count > 0 &&
              (
                  View.Root.ChildRelationships.Any(R => R.SecondType != CswEnumNbtViewRelatedIdType.NodeTypeId ||
                                                   _CswNbtResources.Permit.canAnyTab(
                                                       CswEnumNbtNodeTypePermission.View,
                                                       _CswNbtResources.MetaData.getNodeType(R.SecondId),
                                                       User)))
              ) || IncludeEmptyViews) &&
            View.IsFullyEnabled() &&
            (IncludeEmptyViews || View.ViewMode != CswEnumNbtViewRenderingMode.Grid || null != View.findFirstProperty()) &&
            (!SearchableOnly || View.IsSearchable()) &&
            (false == ForEdit || (_CswNbtResources.CurrentNbtUser.Username == CswNbtObjClassUser.ChemSWAdminUsername || false == CswConvert.ToBoolean(View.IsSystem))));
 }