Add UserInfo property and modified code to assure a person with Reviewer security can only manage annotations created by themself.
Added SessionInfo property to DisplayTabControl class and managed opening and closing DisplayTabItems. Added OwnerID and UserRole properties to DisplayTabItem class and obtained owner id and setup security based on user role when opening an item. Added property to allow forced check in of word document to ignore any changes made by user. Removed debug code Added methods to setup ribbon control based on user's security role. Added SessionInfo property and events and methods to setup proper menu items to appear on the right click of a node based on user's role and checked out status of item.
This commit is contained in:
@@ -29,6 +29,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Properties
|
||||
private bool EnableROEdit;
|
||||
private VlnFlexGrid MyFlexGrid
|
||||
{
|
||||
get
|
||||
@@ -47,6 +48,7 @@ namespace Volian.Controls.Library
|
||||
_MyEditItem = value;
|
||||
if (value != null)
|
||||
{
|
||||
(this.Parent as StepTabPanel).MyDisplayTabItem.SetupSecurity(MyItemInfo);
|
||||
MyStepRTB = value.MyStepRTB;
|
||||
if (value is GridItem)
|
||||
{
|
||||
@@ -427,7 +429,7 @@ namespace Volian.Controls.Library
|
||||
if (_MyStepRTB == null) return;
|
||||
// if we are in view mode or the edit window is empty, then don't allow inserting steps/substeps,
|
||||
// page breaks, copy step, nor creating a pdf
|
||||
bool allow = (_MyStepRTB.TextLength > 0);
|
||||
bool allow = (_MyStepRTB.TextLength > 0 && (MyEditItem == null || MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit));
|
||||
|
||||
// turn ribbon items on/off base on whether there is text in the edit window
|
||||
rbnSiblings.Enabled = rbnBreaks.Enabled = rbnStepParts.Enabled = allow;
|
||||
@@ -590,6 +592,7 @@ namespace Volian.Controls.Library
|
||||
public StepTabRibbon()
|
||||
{
|
||||
InitializeComponent();
|
||||
EnableROEdit = true;
|
||||
_RibbonControl.AutoSize = true;
|
||||
_RibbonControl.SizeChanged += new EventHandler(_RibbonControl_SizeChanged);
|
||||
// When AutoExpand is set to true, [CTRL][F1] and double click will hide/expand the ribbon bar
|
||||
@@ -1631,9 +1634,37 @@ namespace Volian.Controls.Library
|
||||
|
||||
//#endif
|
||||
#endregion
|
||||
|
||||
public void SetupReviewerMode()
|
||||
{
|
||||
if (MyEditItem != null && MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit)
|
||||
{
|
||||
btnToggleEditView_Click(null, new EventArgs());
|
||||
rtabView.Visible = false;
|
||||
rtabHome.Visible = false;
|
||||
rtabInsert.Visible = false;
|
||||
rtabAdmin.Visible = false;
|
||||
rtabReview.Select();
|
||||
}
|
||||
}
|
||||
public void SetupROEditorMode()
|
||||
{
|
||||
btnToggleEditView_Click(null, new EventArgs());
|
||||
rtabView.Visible = false;
|
||||
}
|
||||
public void SetupWriterMode()
|
||||
{
|
||||
EnableROEdit = false;
|
||||
rtabAdmin.Visible = false;
|
||||
}
|
||||
public void SetupSetAdminMode()
|
||||
{
|
||||
}
|
||||
public void SetupAdminMode()
|
||||
{
|
||||
}
|
||||
private void btnToggleEditView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MyEditItem == null) return;
|
||||
MyEditItem.MyStepPanel.VwMode = MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? E_ViewMode.View : E_ViewMode.Edit;
|
||||
MyEditItem.ToggleEditView(MyEditItem.MyStepPanel.VwMode);
|
||||
SetButtonAndMenuEnabling(true);
|
||||
@@ -1777,7 +1808,7 @@ namespace Volian.Controls.Library
|
||||
btnROEdit.Enabled = false;
|
||||
return;
|
||||
}
|
||||
btnROEdit.Enabled = true;
|
||||
btnROEdit.Enabled = EnableROEdit;
|
||||
if (!NewerRoFst()) return;
|
||||
btnUpdROVal.Enabled = true;
|
||||
}
|
||||
@@ -2513,7 +2544,8 @@ namespace Volian.Controls.Library
|
||||
IDataObject iData = Clipboard.GetDataObject();
|
||||
// set to true if editing cell, otherwise false for grids
|
||||
//bool enable = (MyFlexGrid != null && MyFlexGrid.Editor != null);
|
||||
bool enable = (MyFlexGrid != null);
|
||||
|
||||
bool enable = (MyFlexGrid != null && MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit);
|
||||
//btnPasteText.Enabled = btnPasteStepText.Enabled = btnPaste.Enabled = enable;
|
||||
btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)) && enable;
|
||||
btnCMPasteText.Enabled = btnPasteText.Enabled = iData.GetDataPresent(DataFormats.Text) && enable;
|
||||
|
Reference in New Issue
Block a user