public OCL.Attachments AllVisibleAttachments(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); return F.AllVisibleAttachments(AccessingUser,this); }
/// <summary> /// Returns the permission that the AccessingUser has on TargetUser's Group Object /// </summary> /// <param name="AccessingUser"></param> /// <param name="TargetUser"></param> /// <param name="Obj"></param> /// <returns>OCL.Permission if all is well /// Null if Accessing User does not have sufficient priviledge to complete operation /// throws an Exception if Object is not within Group /// </returns> public OCL.Permission GetObjectPermission(OCL.User AccessingUser,OCL.User TargetUser, object Obj) { OCL.Functions F = new OCL.Functions(); return F.GetPermission(this,AccessingUser,TargetUser,Obj); }
public bool UpdateDefaultAttachmentPermission(OCL.User TargetUser,OCL.User AccessingUser,bool CanSee,bool CanAdd, bool CanEdit, bool CanDelete,bool CanEditPermissions, bool CanSeePermissions,bool PropogatePermissions) { if(!this.CanEditAttachmentPermissions(AccessingUser) && !AccessingUser.mvarIsSuperUser) { return false; } OCL.Functions F = new OCL.Functions(); //OCL.User DU = (OCL.User)F.GetUnassignedObject(OCL.OysterUnassignedObjects.User); OCL.Attachment A = (OCL.Attachment)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Attachment); if(PropogatePermissions) { return F.PropagatePermissionsOfObjectType(this,TargetUser,OCL.OysterObjectType.Attachment,CanSee,CanAdd,CanEdit,CanDelete, false,CanEditPermissions,CanSeePermissions, false,false,false, false,false,false, AccessingUser.ID); } else { return F.UpdatePermission(this,TargetUser,OCL.OysterObjectType.Attachment,A.mvarID,CanSee,CanAdd,CanEdit,CanDelete, false,CanEditPermissions,CanSeePermissions, false,false,false, false,false,false, AccessingUser.ID); } }
/// <summary> /// Returns the Accessing User's Default Recording Session Permission /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultRecordingSessionPermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.RecordingSession DRS = (OCL.RecordingSession)F.GetUnassignedObject(OCL.OysterUnassignedObjects.RecordingSession); return F.GetPermission(this,AccessingUser,DRS); }
/// <summary> /// Returns the AccessingUser's Default User Permission /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultUserPermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.User DU = (OCL.User)F.GetUnassignedObject(OCL.OysterUnassignedObjects.User); return F.GetPermission(this,AccessingUser,DU); }
/// <summary> /// Returns the Accessing User's Default Recording Session Permission /// Example: By default when a recording session is added to this Group the Accessing User can /// see,edit or delete Recordings Sessions based on this permission /// The permissions on a particular Recording Session within this group for this user will override /// the default recording session permissions. /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultAttachmentPermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Attachment DA = (OCL.Attachment)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Attachment); return F.GetPermission(this,AccessingUser,DA); }
/// <summary> /// Returns the Accessing User's Access Permissions to this Group /// Example: can Accessing User see this Group, edit this Group, delete this Group /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultGroupAccessPermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Group DG = (OCL.Group)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Group); return F.GetPermission(this,AccessingUser,DG); }
/// <summary> /// Returns true or false if the AccessingUser Can Delete this recording from System /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public bool CanDelete(OCL.User AccessingUser) { string sSQL = ""; if(AccessingUser.mvarIsSuperUser) { return true; } OCL.Functions F = new OCL.Functions(); OCL.RecordingSession RS = F.GetSession(this.SessionID); if(RS.OwnerID == AccessingUser.mvarID) return true; OCL.Group DefaultGroup = (OCL.Group)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Group); sSQL = "Select IsVisible FROM tblGroupTokens WHERE DefaultGroup = " + DefaultGroup.ID + " AND UserId = " + AccessingUser.ID + " AND ObjectTypeId = " + Convert.ToInt32(OCL.OysterObjectType.Recording) + " AND ObjectId = " + this.mvarID + " AND IsVisible <> 0" + " AND CanDelete <> 0"; int numrecs = F.ExecuteNonQuery(sSQL); if(numrecs == 0) return false; else return true; }
/// <summary> /// Returns true if AccessingUser can change permissions on recordings /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public bool CanEdit(OCL.User AccessingUser) { if(AccessingUser.mvarIsSuperUser) return true; else { OCL.Functions F = new OCL.Functions(); return F.CheckAllGroupsForObjectPermission(AccessingUser,Convert.ToInt32(OCL.OysterObjectType.Recording), this.ID,OCL.OysterPermissions.CanEdit); } }
public void GetAttachment(OCL.User AccessingUser, int[] AttachmentIds, string sDestination, bool ShowProgress) { ///Possible To Do: Add a Security Check to see if Accessing User has privilege /// to download attachment. As of today. Anyone with the ability to view /// a Note can get download its attachments. /// The reasong to have OCL.User AccessingUser is so that if this feature gets /// implemented the function will keep working just the same in legacy code. OCL.Functions F = new OCL.Functions(); //OCL.Recording R = F.GetRecording(this.RecordingID); F.GetNoteAttachment(AttachmentIds,sDestination,ShowProgress); }
public void RemoveAttachment(OCL.User AccessingUser,OCL.Attachment FileAttachment) { OCL.Functions F = new OCL.Functions(); //OCL.Recording R = F.GetRecording(this.RecordingID); OCL.Note CNote = F.GetNote(mvarID); // if(R.OwnerID == AccessingUser.ID) // { if(CNote.HasAttachment) { try { F.RemoveNoteAttachment(mvarID,FileAttachment.ID); } catch(Exception Err) { throw new Exception(Err.Message); } } // } }
public bool CanSee(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); //OCL.RecordingSession RS = F.GetSession(this.SessionID); if(AccessingUser.mvarIsSuperUser) { return true; } else { //OCL.Group DefaultGroup = (OCL.Group)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Group); return F.CheckAllGroupsForObjectPermission(AccessingUser,Convert.ToInt32(OCL.OysterObjectType.Note), this.mvarID,OCL.OysterPermissions.IsVisible); } }
public bool CanEdit(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); //OCL.RecordingSession RS = F.GetSession(this.SessionID); if(AccessingUser.mvarIsSuperUser) { return true; } else { OCL.Group DefaultGroup = (OCL.Group)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Group); OCL.Permission P = DefaultGroup.GetObjectPermission(AccessingUser,this); if(P != null) { return P.CanEdit; } else { return false; } } }
public OCL.Attachments AllVisibleAttachments(OCL.User AccessingUser, OCL.Group TargetGroup) { OCL.Functions F = new OCL.Functions(); return F.AllVisibleAttachments(AccessingUser,TargetGroup,this); }
public OCL.Sources AllVisibleSources(OCL.User AccessingUser, OCL.Scene TargetScene) { OCL.Functions F = new OCL.Functions(); OCL.Sources SS = F.AllVisibleSources(AccessingUser,this,TargetScene); return SS; }
public bool CanWatch(OCL.User AccessingUser) { if(AccessingUser.mvarIsSuperUser) { return true; } string sSQL = "Select IsVisible FROM tblGroupTokens WHERE ObjectTypeId = " + Convert.ToInt32(OCL.OysterObjectType.Recording) + " AND ObjectId = " + this.mvarID + " AND IsVisible <> 0" + " AND IsUsable <> 0"; OCL.Functions F = new OCL.Functions(); int numrecs = F.ExecuteNonQuery(sSQL); if(numrecs == 0) return false; else return true; }
/// <summary> /// Returns all RecordingSessions in this group that are visible to the AccessingUser /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.RecordingSessions CurrentRecordingSessions(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); RecordingSessions RR = F.GetAllVisibleRecordingSessions(AccessingUser,this); return RR; }
/// <summary> /// Update recordings permission within a given group /// </summary> /// <param name="AccessingUser"></param> /// <param name="QueryGroup"></param> /// <param name="CanSee"></param> /// <param name="CanAdd"></param> /// <param name="CanEdit"></param> /// <param name="CanDelete"></param> /// <param name="CanWatch"></param> /// <returns></returns> public bool UpdateGroupPermission(OCL.User AccessingUser,OCL.Group QueryGroup,bool CanSee,bool CanAdd, bool CanEdit, bool CanDelete, bool CanWatch, bool CanEditPermissions, bool CanSeePermissions) { OCL.Functions F = new OCL.Functions(); if(!F.CheckGroupObjectPermission(AccessingUser,QueryGroup,Convert.ToInt32(OCL.OysterObjectType.Recording), this.ID,OCL.OysterPermissions.CanEdit)) { return false; } OCL.User DU = (OCL.User)F.GetUnassignedObject(OCL.OysterUnassignedObjects.User); return F.UpdatePermission(QueryGroup,DU,OCL.OysterObjectType.Recording,this.ID,CanSee,CanAdd,CanEdit,CanDelete, CanWatch,CanEditPermissions,CanSeePermissions, false,false,false, false,false,false, AccessingUser.ID); }
/// <summary> /// Returns the AccessingUser's Default Control Permission /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultControlPermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Control DC = (OCL.Control)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Control); return F.GetPermission(this,AccessingUser,DC); }
public bool UpdateDefaultRecordingSessionPermission(OCL.User TargetUser,OCL.User AccessingUser,bool CanSee,bool CanAdd, bool CanEdit, bool CanDelete, bool IsUsable,bool CanEditPermissions, bool CanSeePermissions, bool CanAddNotes, bool CanEditNotes, bool CanRemoveNotes, bool PropogatePermissions) { if(!this.CanEditRecordingSessionPermissions(AccessingUser) && !AccessingUser.mvarIsSuperUser) { return false; } OCL.Functions F = new OCL.Functions(); //OCL.User DU = (OCL.User)F.GetUnassignedObject(OCL.OysterUnassignedObjects.User); OCL.RecordingSession DRS = (OCL.RecordingSession)F.GetUnassignedObject(OCL.OysterUnassignedObjects.RecordingSession); if(PropogatePermissions) { return F.PropagatePermissionsOfObjectType(this,TargetUser,OCL.OysterObjectType.RecordingSession,CanSee,CanAdd,CanEdit,CanDelete, IsUsable,CanEditPermissions,CanSeePermissions, CanAddNotes,CanEditNotes,CanRemoveNotes, false,false,false, AccessingUser.ID); } else { return F.UpdatePermission(this,TargetUser,OCL.OysterObjectType.RecordingSession,DRS.mvarID,CanSee,CanAdd,CanEdit,CanDelete, IsUsable,CanEditPermissions,CanSeePermissions, CanAddNotes,CanEditNotes,CanRemoveNotes, false,false,false,AccessingUser.ID); } }
/// <summary> /// Returns the AccessingUser's Default Note Permission /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultNotePermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Note DN = (OCL.Note)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Note); return F.GetPermission(this,AccessingUser,DN); }
public OCL.Recordings WatchableRecordings(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); Recordings RR = F.GetAllWatchableRecordings(AccessingUser,this); return RR; }
/// <summary> /// Returns the AccessingUser's Default Source Permission /// </summary> /// <param name="AccessingUser"></param> /// <returns></returns> public OCL.Permission GetDefaultSourcePermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Source DS = (OCL.Source)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Source); return F.GetPermission(this,AccessingUser,DS); }
public OCL.Controls AllVisibleControls(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Controls CC = F.AllVisibleControls(AccessingUser,this); return CC; }
public OCL.Permission GetDefaultVideoStorageServerPermission(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.VideoStorageServer VSS = (OCL.VideoStorageServer)F.GetUnassignedObject(OCL.OysterUnassignedObjects.VideoStorageServer); return F.GetPermission(this,AccessingUser,VSS); }
public OCL.Controls AllVisibleControls(OCL.User AccessingUser,OCL.Scene TargetScene) { OCL.Functions F = new OCL.Functions(); OCL.Controls CC = F.AllVisibleControls(AccessingUser,this,TargetScene); return CC; }
public void Update(string Description) { try { string sSQL = "UPDATE tblGroup SET Description = '" + Description + "' WHERE Id =" + mvarID; OCL.Functions F = new OCL.Functions(); int numrecs = F.ExecuteSqlCommand(sSQL); } catch(Exception Err) { throw new ApplicationException(Err.Message,Err.InnerException); } }
public OCL.Sources AllVisibleSources(OCL.User AccessingUser) { OCL.Functions F = new OCL.Functions(); OCL.Sources SS = F.AllVisibleSources(AccessingUser,this); return SS; }
public bool UpdateDefaultControlPermission(OCL.User TargetUser,OCL.User AccessingUser,bool CanSee,bool CanAdd, bool CanEdit, bool CanDelete,bool IsUsable,bool CanEditPermissions,bool CanSeePermissions, bool PropogatePermissions) { if(!this.CanEditControlPermissions(AccessingUser) && !AccessingUser.mvarIsSuperUser) { return false; } OCL.Functions F = new OCL.Functions(); OCL.User DU = (OCL.User)F.GetUnassignedObject(OCL.OysterUnassignedObjects.User); OCL.Control DS = (OCL.Control)F.GetUnassignedObject(OCL.OysterUnassignedObjects.Control); if(PropogatePermissions) { return F.PropagatePermissionsOfObjectType(this,TargetUser,OCL.OysterObjectType.Control,CanSee,CanAdd,CanEdit,CanDelete, IsUsable,CanEditPermissions,CanSeePermissions, false,false,false, false,false,false,AccessingUser.ID); } else { return F.UpdatePermission(this,TargetUser,OCL.OysterObjectType.Control,DS.ID,CanSee,CanAdd,CanEdit,CanDelete, IsUsable,CanEditPermissions,CanSeePermissions, false,false,false, false,false,false,AccessingUser.ID); } }
/// <summary> /// This will add a file to a given Note. /// attachment. /// </summary> /// <param name="AccessingUser"></param> /// <param name="sFile"></param> public OCL.Attachments AddAttachments(OCL.User AccessingUser, string[] sFile,ref OCL.FTPTransfer FTP) { OCL.Functions F = new OCL.Functions(); //OCL.Recording R = F.GetRecording(this.RecordingID); OCL.Note CNote = F.GetNote(mvarID); ///Possible To Do: Add a Security Check to see if Accessing User has privilege /// to download attachment. As of today. Anyone with the ability to view /// a Note can get download its attachments. /// The reasong to have OCL.User AccessingUser is so that if this feature gets /// implemented the function will keep working just the same in legacy code. /// /// if(R.OwnerID == AccessingUser.ID) /// { /// } try { //OCL.Attachment A = F.SetNoteAttachment(mvarID, sFile, ShowProgress); OCL.Attachments A = F.SetNoteAttachments(mvarID, sFile, ref FTP); return A; } catch(Exception Err) { throw new Exception(Err.Message); } }