protected override bool CheckSecurity() { if (!base.CheckSecurity()) { return(false); } if (targetChapter != null) { return(targetCommittee.ShowInPortal && canManageCommittees(targetChapter.Leaders)); } if (targetSection != null) { return(targetCommittee.ShowInPortal && canManageCommittees(targetSection.Leaders)); } if (targetOrganizationalLayer != null) { return(targetCommittee.ShowInPortal && canManageCommittees(targetOrganizationalLayer.Leaders)); } using (var api = GetServiceAPIProxy()) return(CommitteeLogic.IsAdministrativeMember(api, targetCommittee.ID, ConciergeAPI.CurrentEntity.ID)); }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Jeste li sigurni?", "Upozorenje", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { CommitteeLogic.Delete(_committeeToUpdate); Close(); } }
protected override bool CheckSecurity() { if (!base.CheckSecurity()) { return(true); } using (var api = GetConciegeAPIProxy()) return(CommitteeLogic.IsMember(api, ContextID, ConciergeAPI.CurrentEntity.ID)); }
private void frmRegistration_Load(object sender, EventArgs e) { LoginLogic l = new LoginLogic(); listArray = l.GetDate(); cbxMonth.DataSource = listArray[0]; cbxYear.DataSource = listArray[4]; cbxCommittee.DataSource = CommitteeLogic.Get(); cbxCommittee.ValueMember = "Id"; cbxCommittee.DisplayMember = "Name"; }
public static bool CanAccess(string fileCabinetID, string folderID, string entityID) { // ok, first, let's see what kind of file cabinet it is using (var api = ConciergeAPIProxyGenerator.GenerateProxy()) { var msoFileCabinet = api.Get(fileCabinetID).ResultValue; switch (msoFileCabinet.ClassType) { case msCommitteeFileCabinet.CLASS_NAME: if (CommitteeLogic.IsMember(api, msoFileCabinet.SafeGetValue <string>( msCommitteeFileCabinet.FIELDS.Committee), ConciergeAPI.CurrentEntity.ID)) { return(true); } break; case msSectionFileCabinet.CLASS_NAME: return(CanViewMembershipDocuments(api, msoFileCabinet.SafeGetValue <string>("Section"), entityID)); case msChapterFileCabinet.CLASS_NAME: return(CanViewMembershipDocuments(api, msoFileCabinet.SafeGetValue <string>("Chapter"), entityID)); case msOrganizationalLayerFileCabinet.CLASS_NAME: return(CanViewMembershipDocuments(api, msoFileCabinet.SafeGetValue <string>("OrganizationalLayer"), entityID)); } // ok - now, am I entitled to the file folder? // I'm going to check the folder directly, and then all of the parent folders var entitlements = api.ListEntitlements(ConciergeAPI.CurrentEntity.ID, msFileFolderEntitlement.CLASS_NAME).ResultValue; if (entitlements.Exists(x => x.Context == folderID)) { return(true); } // ok, what about any parent folders? var folderInfo = api.DescribeFolder(folderID).ResultValue; if (folderInfo.ParentFolders != null) { foreach (var pf in folderInfo.ParentFolders) { if (entitlements.Exists(x => x.Context == pf.FolderID)) // if you have access to the parent, you're good { return(true); } } } } return(false); // no access }
private void setupCommitteeAdminLinks() { if (ConciergeAPI.CurrentEntity == null) { return; // can't join if not logged in } using (var api = GetServiceAPIProxy()) if (!CommitteeLogic.IsAdministrativeMember(api, targetCommittee.ID, ConciergeAPI.CurrentEntity.ID)) { return; } hlEdit.Visible = true; hlEdit.NavigateUrl += ContextID; }
private void btnSave_Click(object sender, EventArgs e) { Committee c = new Committee(); c.Name = txtName.Text; if (_committeeToUpdate == null) { CommitteeLogic.Add(c); } else { CommitteeLogic.Update(_committeeToUpdate, c); } Close(); }
public static bool HasAdministrativeAccessTo(msFileFolder targetFolder, string entityID) { // checks to see if the entity has administrative access to the folder // ok, first, let's see what kind of file cabinet it is using (var api = ConciergeAPIProxyGenerator.GenerateProxy()) { var msoFileCabinet = api.Get(targetFolder.FileCabinet).ResultValue; switch (msoFileCabinet.ClassType) { case msCommitteeFileCabinet.CLASS_NAME: return(CommitteeLogic.IsAdministrativeMember(api, msoFileCabinet.SafeGetValue <string>( msCommitteeFileCabinet.FIELDS.Committee), ConciergeAPI.CurrentEntity.ID)); case msSectionFileCabinet.CLASS_NAME: case msChapterFileCabinet.CLASS_NAME: case msOrganizationalLayerFileCabinet.CLASS_NAME: string typeName = msoFileCabinet.ClassType.Replace("FileCabinet", ""); Search sLeaders = new Search(typeName + "Leader"); sLeaders.AddCriteria(Expr.Equals(typeName, msoFileCabinet[typeName])); sLeaders.AddCriteria(Expr.Equals(msMembershipLeader.FIELDS.Individual, entityID)); sLeaders.AddOutputColumn("ListIndex"); sLeaders.AddSortColumn("ListIndex"); return(api.GetSearchResult(sLeaders, 0, 1).TotalRowCount > 0); case msAssociationFileCabinet.CLASS_NAME: return(false); // you never have write access default: throw new NotSupportedException("Unkown file cabinet type" + msoFileCabinet.ClassType); } } }
private void ShowCommittees() { committeeBindingSource.DataSource = null; committeeBindingSource.DataSource = CommitteeLogic.Get(); }