Carrotware.CMS.Core.ContentPageHelper.RecordPageLock C# (CSharp) Метод

RecordPageLock() публичный Метод

public RecordPageLock ( System.Guid rootContentID, System.Guid siteID, System.Guid currentUserID ) : bool
rootContentID System.Guid
siteID System.Guid
currentUserID System.Guid
Результат bool
        public bool RecordPageLock(Guid rootContentID, Guid siteID, Guid currentUserID)
        {
            bool bLock = IsPageLocked(rootContentID, siteID, currentUserID);
            bool bRet = false;

            if (!bLock) {
                ExtendedUserData usr = new ExtendedUserData(currentUserID);

                //only allow admin/editors to record a lock
                if (usr.IsAdmin || usr.IsEditor) {
                    bRet = RecordHeartbeatLock(rootContentID, siteID, currentUserID);
                }
            }

            return bRet;
        }

Usage Example

Пример #1
0
		public void Load() {
			this.TheSite = SiteData.CurrentSite;

			if (SecurityData.AdvancedEditMode && !this.IsPageLocked) {
				using (ContentPageHelper pageHelper = new ContentPageHelper()) {
					bool bRet = pageHelper.RecordPageLock(this.ThePage.Root_ContentID, this.TheSite.SiteID, SecurityData.CurrentUserGuid);
				}
			}

			CMSConfigHelper.IdentifyLinkAsInactive(this.ThePage);
			Guid guidContentID = Guid.Empty;

			if (this.ThePage != null) {
				guidContentID = this.ThePage.Root_ContentID;
				this.TheWidgets = SiteData.GetCurrentPageWidgets(guidContentID);
			} else {
				this.ThePage = new ContentPage();
				this.TheWidgets = new List<Widget>();
			}
		}