send MyUserInfo (security) to the TreeView module

Don’t allow Reviewers and RO Editor only users save changes to Word attachments and library documents
Put a Create PDF button on the Review ribbon
Don’t allow Reviewers and RO Editor only users move procedures and folders on the tree
This commit is contained in:
2016-01-21 19:30:35 +00:00
parent f3b86f2a46
commit ea9e0831c8
6 changed files with 264 additions and 191 deletions

View File

@@ -383,6 +383,12 @@ namespace Volian.Controls.Library
get { return _MySessionInfo; }
set { _MySessionInfo = value; }
}
private UserInfo _MyUserInfo;
public UserInfo MyUserInfo
{
get { return _MyUserInfo; }
set { _MyUserInfo = value; }
}
#region Local Vars
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -3047,7 +3053,7 @@ namespace Volian.Controls.Library
DragHelper.ImageList_DragMove(formP.X - this.Left, formP.Y - this.Top);
DropLocation dl = new DropLocation(this, e, _LastDropLocation == null ? DateTime.Now : _LastDropLocation.LastScroll);
string s = string.Empty;
if (dl.DropNode == null)
if (dl.DropNode == null || !AllowedToMove((VETreeNode)dragNode))
{
e.Effect = DragDropEffects.None;
}
@@ -3106,6 +3112,23 @@ namespace Volian.Controls.Library
if (dvInfo != null) return true;
return false;
}
private bool AllowedToMove(VETreeNode dragNode)
{
DocVersionInfo dvInfo = null;
if (IsFolder(dragNode))
{
FolderInfo fi = dragNode.VEObject as FolderInfo;
return (MyUserInfo.IsAdministrator() || MyUserInfo.IsSetAdministrator(fi));
}
else if (IsDocVersion(dragNode))
dvInfo = dragNode.VEObject as DocVersionInfo;
else if (IsProcedure(dragNode))
dvInfo = (dragNode.VEObject as ProcedureInfo).MyDocVersion;
else if (IsSection(dragNode))
dvInfo = (dragNode.VEObject as SectionInfo).MyDocVersion;
if (dvInfo != null) return !(MyUserInfo.IsReviewer(dvInfo) || MyUserInfo.IsROEditor(dvInfo));
return false;
}
private static TreeNode GetTreeNodeFromData(IDataObject datobj)
{
foreach (string s in datobj.GetFormats())