/// <summary> /// Check if user can edit event. /// </summary> /// <returns></returns> public bool IsCanEditEvent(UserEvent userEvent) { if (!ID.HasValue) return false; // if personal event or user is admin. if (userEvent.OwnerID == ID.Value || !userEvent.IsSaved || IsInRole(RolesEnum.Administrator)) return true; return false; }
/// <summary> /// Check if user can edit event. /// </summary> /// <returns></returns> public bool IsCanEditEvent(int userEventID) { UserEvent userEvent = new UserEvent(userEventID); return IsCanEditEvent(userEvent); }