public static void DeleteScript(string id) { BaseService.CheckLoginAndLicense(); CmsScript script = GetScript(id); script = BaseObject.GetById <CmsScript>(new Guid(id)); if (script.HasAutorisation) { if (!script.IsAutorized(SessionObject.CurrentBitplateUser)) { throw new Exception("U heeft geen rechten voor dit script"); } } BitCaching.RemoveItemFromCache(script.ID.ToString()); script.Delete(); }
public static CmsScript GetScript(string id) { BaseService.CheckLoginAndLicense(); CmsScript script = new CmsScript(); if (id != null) { script = BaseObject.GetById <CmsScript>(new Guid(id)); if (script.HasAutorisation) { if (!script.IsAutorized(SessionObject.CurrentBitplateUser)) { throw new Exception("U heeft geen rechten voor dit script"); } } } else { script.Site = SessionObject.CurrentSite; } return(script); }