Exemple #1
0
        /// <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;
        }