public static void LogIn(Staff thisUser, Entities thisEntity) { MyStaffRecord = thisUser; MyName = thisUser.FullName; MyStaffID = thisUser.ID; MyUserID = thisUser.UserID; EntityFunctions.UpdateCurrentEntity(ref thisEntity); EntityFunctions.UpdateMyDefaultEntity(ref thisEntity); MyPermissions = new TableSecurity(MyStaffRecord); }
// Menu settings // public void MenuSecurity() { try { myPermissions = Globals.MyPermissions; NewEntity.Visibility = myPermissions.ShowOrCollapse("AddEntities"); AmendEntity.Visibility = myPermissions.ShowOrCollapse("EditEntities"); ViewStaff.Visibility = myPermissions.ShowOrCollapse("ViewStaff"); NewStaff.Visibility = myPermissions.ShowOrCollapse("AddStaff"); AmendStaff.Visibility = myPermissions.ShowOrCollapse("EditStaff"); StaffEntities.Visibility = myPermissions.ShowOrCollapse("ViewStaffEntities"); ViewProduct.Visibility = myPermissions.ShowOrCollapse("ViewProducts"); NewProduct.Visibility = myPermissions.ShowOrCollapse("AddProducts"); AmendProduct.Visibility = myPermissions.ShowOrCollapse("EditProducts"); ViewClient.Visibility = myPermissions.ShowOrCollapse("ViewClients"); NewClient.Visibility = myPermissions.ShowOrCollapse("AddClients"); AmendClient.Visibility = myPermissions.ShowOrCollapse("EditClients"); ClientContact.Visibility = myPermissions.ShowOrCollapse("ViewClientStaff"); ClientProduct.Visibility = myPermissions.ShowOrCollapse("ViewClientProducts"); ViewProject.Visibility = myPermissions.ShowOrCollapse("ViewProjects"); NewProject.Visibility = myPermissions.ShowOrCollapse("AddProjects"); AmendProject.Visibility = myPermissions.ShowOrCollapse("EditProjects"); ProjectStaff.Visibility = myPermissions.ShowOrCollapse("ViewProjectTeams"); ProjectContact.Visibility = myPermissions.ShowOrCollapse("ViewClientTeams"); ProjectProduct.Visibility = myPermissions.ShowOrCollapse("ViewProjectProducts"); ProjectTimeline.Visibility = myPermissions.ShowOrCollapse("ViewStageHistory"); ProjectAction.Visibility = myPermissions.ShowOrCollapse("ViewActions"); AuditLog.Visibility = myPermissions.ShowOrCollapse("ViewAuditEntries"); ErrorLog.Visibility = myPermissions.ShowOrCollapse("ViewErrorLog"); StaffMenu.IsEnabled = subMenuItemsVisible(StaffMenu); ProductMenu.IsEnabled = subMenuItemsVisible(ProductMenu); ClientMenu.IsEnabled = subMenuItemsVisible(ClientMenu); ProjectMenu.IsEnabled = subMenuItemsVisible(ProjectMenu); AdminMenu.IsEnabled = subMenuItemsVisible(AdminMenu); } catch (Exception generalException) { MessageFunctions.Error("Error setting menu permissions", generalException); } }