Hello everyonethis is my first thread here. I have already read some useful threads and information so thanks a lot for all of you that share your wisdom.I have a problem with the fileSite SDK. I need to be able to display the security dialog (that one can easily find in the property dialog of a folder or a workspace for example) to manage groups/user permissions. This is in a stand-alone development so the user can't call the properties panel first, I have to get the security dialog displayed directly.So I looked deeply in the IManExt and IManExt2 libs and found the undocummented class called : UsrGrpSecurityCmdClassI believe this is the right one to use (the corresponding dialog class has the right look). However, I have absolutely no information on the ContextItem needed to use this command. I have added the sessions, DMS, and also tried some inputs like :"NRTDatabase", "SelectedDatabase", "Database"... but the dialog keeps on raising the error :"database property not set" when trying to display the dialog.Does anyone have ever used this dialog and can help me finding the necessary ContextItems to set please ?Thanks a lot in advancecheers
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using IManage;using IMANEXTLib;namespace UsrGrpSecDlgForFolder{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { IManDMS dms = new ManDMSClass(); IManSession sess = dms.Sessions.Add("DSS_WIN2003SERV"); sess.TrustedLogin(); //Get database IManDatabase db = sess.PreferredDatabase; //Get workspace IManWorkspace ws = (IManWorkspace)dms.GetObjectBySID("!nrtdms:0:!sessionSS_WIN2003SERV:!database:WS8DSS1:!page:6:"); string[] usrnames = null; string[] grpnames = null; imAccessRight[] usrrights = null; imAccessRight[] grprights = null; IManUserACLs uacls = ws.Security.UserACLs; if ((uacls != null) && (uacls.Empty == false)) { usrnames = new string[uacls.Count]; for (int i = 1; i <= uacls.Count; i++) { usrnames[i - 1] = uacls.ItemByIndex(i).User.Name; } usrrights = new imAccessRight[uacls.Count]; for (int j = 1; j <= uacls.Count; j++) { usrrights[j - 1] = uacls.ItemByIndex(j).Right; } } IManGroupACLs gacls = ws.Security.GroupACLs; if ((gacls != null) && (gacls.Empty == false)) { grpnames = new string[gacls.Count]; for (int i = 1; i <= gacls.Count; i++) { grpnames[i - 1] = gacls.ItemByIndex(i).Group.Name; } grprights = new imAccessRight[gacls.Count]; for (int j = 1; j <= gacls.Count; j++) { grprights[j - 1] = gacls.ItemByIndex(j).Right; } } UsrGrpSecurityDlg dlg = new UsrGrpSecurityDlgClass(); dlg.NRTDatabase = (NRTDatabase)db; dlg.DefaultSecurityType = (SecurityType)ws.Security.DefaultVisibility; dlg.EnableExternal = false; dlg.UserNameArray = usrnames; dlg.UserAccessRightsArray = usrrights; dlg.GroupNameArray = grpnames; dlg.GroupAccessRightsArray = grprights; dlg.Show(this.Handle.ToInt32()); if(dlg.SecurityChanged == true) { //Update container security Array uNames = null; Array uRights = null; Array gRights = null; Array gNames = null; //Get edited user ACL's uNames = (Array)dlg.UserNameArray; uRights = (Array)dlg.UserAccessRightsArray; //Clear previous uacls.Clear(); if (uacls.Empty == true) { //Set changes for (int i = 0; i < uNames.Length; i++) { uacls.Add(uNames.GetValue(i).ToString(), (imAccessRight)uRights.GetValue(i)); } } //Get edited group ACL's gNames = (Array)dlg.GroupNameArray; gRights = (Array)dlg.GroupAccessRightsArray; //Clear previous gacls.Clear(); if (gacls.Empty == true) { //Set changes for (int i = 0; i < gNames.Length; i++) { gacls.Add(gNames.GetValue(i).ToString(), (imAccessRight)gRights.GetValue(i)); } } } ws.Update();//commit security changes to the server. this.Close(); } }}