Esempio n. 1
0
		private void MainForm_Load(object sender, EventArgs e) {
			// Set User Acceess Rights
			RoleBasedSecurityManager sec = new RoleBasedSecurityManager();
			sec.CurrentRole = StandardRole.SuperUser;
			project.SecurityManager = sec;

			xmlStore.DirectoryName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"WebVisits");

			project.Name = "Webvisits Project";
			project.Create();
			project.LibrarySearchPaths.Add(Application.StartupPath);
			project.AddLibraryByName("Dataweb.nShape.GeneralShapes");
			project.AddLibraryByName("Dataweb.nShape.SoftwareArchitectureShapes");

			CreateLineStyles();

			// Delete default tools
			toolBoxAdapter.ToolSetController.Clear();
			toolBoxAdapter.ListView.ShowGroups = false;

			FillToolBox();
		}
Esempio n. 2
0
 public static void UpdatePermissionTableCtrls(RoleBasedSecurityManager securityManager, TableLayoutPanel panel, char securityDomain, SecurityAccess access)
 {
     bool isGranted = false;
     foreach (Permission permission in Enum.GetValues(typeof(Permission))) {
         switch (permission) {
             case Permission.All:
             case Permission.None:
                 break;
             case Permission.Designs:
             case Permission.Security:
             case Permission.Templates: {
                     isGranted = securityManager.IsGranted(permission, access);
                     SetCheckState(panel, permission, access, isGranted);
                 }
                 break;
             case Permission.Connect:
             case Permission.Data:
             case Permission.Delete:
             case Permission.Insert:
             case Permission.Layout:
             case Permission.Present: {
                     isGranted = (securityDomain != NoDomain) ? securityManager.IsGranted(permission, access, securityDomain) : false;
                     SetCheckState(panel, permission, access, isGranted);
                 }
                 break;
             default:
                 Debug.Fail("Unhandled Permission!");
                 break;
         }
     }
 }