Ejemplo n.º 1
0
 public virtual void SetReadOnly(bool readOnly)
 {
     this.IsReadOnly = readOnly;
     if (TablePropertiesPanel != null)
     {
         TablePropertiesPanel.SetReadOnly(readOnly);
     }
     if (TableCellParameterPanel != null)
     {
         TableCellParameterPanel.SetReadOnly(readOnly);
     }
     if (AllocationPropertiesPanel != null)
     {
         AllocationPropertiesPanel.SetReadOnly(readOnly);
     }
     if (SpreadSheet != null)
     {
         SpreadSheet.SetReadOnly(readOnly);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Customize for connected user
        /// </summary>
        /// <param name="rights"></param>
        /// <param name="readOnly"></param>
        public virtual void Customize(List <Kernel.Domain.Right> rights, bool readOnly = false)
        {
            bool edit           = RightsUtil.HasRight(Kernel.Domain.RightType.EDIT, rights);
            bool editCell       = RightsUtil.HasRight(Kernel.Domain.RightType.EDIT_CELL, rights);
            bool editAllocation = RightsUtil.HasRight(Kernel.Domain.RightType.EDIT_ALLOCATION, rights);

            if (TablePropertiesPanel != null)
            {
                TablePropertiesPanel.SetReadOnly(readOnly || !edit);
            }
            if (TableCellParameterPanel != null)
            {
                TableCellParameterPanel.SetReadOnly(readOnly || !editCell);
            }
            if (AllocationPropertiesPanel != null)
            {
                AllocationPropertiesPanel.SetReadOnly(readOnly || !editAllocation);
            }
            if (SpreadSheet != null)
            {
                SpreadSheet.SetReadOnly(readOnly || !edit);
            }
        }