Use static function to check user’s security level in allowing changes to step properties

Use static function to check user’s security level in allowing the insert or change of a transition
Use static function to check user’s security level in allowing the user to edit a table cell
Use static function to check user’s security level in allowing text modifications when keyboard shortcuts are used
ROEditor only security is now also considered a Reviewer.  Don’t allow a Review goto an RO (run the RO editor), Don’t allow a Reviewer toggle out of view mode from the context menu, for Reviewers, don’t allow the Enter key enter new steps and substeps.
For Reviewers, when on a table (grid) have the Enter Key move down to the next step element, don’t allow Reviewers edit a table
This commit is contained in:
2015-12-09 21:04:02 +00:00
parent d8f7b0619c
commit bc6fcfd05b
6 changed files with 160 additions and 50 deletions

View File

@@ -232,6 +232,27 @@ namespace Volian.Controls.Library
OnEditModeChanged(this, new EventArgs());
}
}
private DocVersionInfo _MyDVI = null;
public DocVersionInfo MyDVI
{
get
{
ItemInfo procInfo = _MyItemInfo.MyProcedure as ItemInfo;
if (procInfo == null)
_MyDVI = null;
else
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
return _MyDVI;
}
}
private static UserInfo _MyUserInfo = null;
public static UserInfo MyUserInfo
{
get { return _MyUserInfo; }
set { _MyUserInfo = value; }
}
private static string _MySymbolFontName;
public static string MySymbolFontName
{
@@ -1881,7 +1902,7 @@ namespace Volian.Controls.Library
if (newend > 0) SetSelection(SelectionStart, newend - SelectionStart);
break;
case Keys.Space:
if (e.Control) // Hardspace - Ctrl+Shift+Space
if (e.Control && MyDVI!= null && UserInfo.CanEdit(MyUserInfo,MyDVI)); // Hardspace - Ctrl+Shift+Space
InsertSymbol(@"\u160?");
break;
case Keys.F3: // shift F3
@@ -2283,13 +2304,22 @@ namespace Volian.Controls.Library
case Keys.Enter:
if (!e.Control && !e.Shift && !e.Alt)
{
OnEnterKeyPressed(sender, e);
if (UserInfo.CanEdit(MyUserInfo,MyItemInfo.MyDocVersion))
OnEnterKeyPressed(sender, e);
else
{
// user cannot change data so just move to the next step element
StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); // perform a <Ctrl><DownArrow>
HandleLocalSelectionChange();
e.Handled = true;
}
}
break;
case Keys.F2:
if (e.Alt && !e.Control && !e.Shift) // toggle change bar
{
OnToggleChangeBar(this, new EventArgs());
if (MyUserInfo.IsAdministrator() || MyUserInfo.IsSetAdministrator(MyDVI) || MyUserInfo.IsWriter(MyDVI))
OnToggleChangeBar(this, new EventArgs());
e.Handled = true;
}
break;