示例#1
0
文件: Group.cs 项目: CarverLab/Oyster
        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);
            }
        }
示例#2
0
文件: Group.cs 项目: CarverLab/Oyster
        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);
            }
        }
示例#3
0
文件: Group.cs 项目: CarverLab/Oyster
        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);
            }
        }