public static bool CheckUserRight(int timeTrackingBlockId, string rightName) { if (rightName == null) { throw new ArgumentNullException("rightName"); } bool bRetVal = false; if (Mediachase.Ibn.License.TimeTrackingModule) { string key = string.Format(CultureInfo.InvariantCulture, "_ttb_{0}_right_{1}", timeTrackingBlockId, rightName); if (HttpContext.Current == null || HttpContext.Current.Items[key] == null) { TimeTrackingBlock ttb = MetaObjectActivator.CreateInstance <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), timeTrackingBlockId); SecurityService ss = ttb.GetService <SecurityService>(); if (ss != null) { bRetVal = ss.CheckUserRight(rightName); } if (HttpContext.Current != null) { HttpContext.Current.Items[key] = bRetVal; } } else { bRetVal = (bool)HttpContext.Current.Items[key]; } } return(bRetVal); }
protected override void OnSaving() { int blockId = this.ParentBlockId; // O.R. [2008-07-29] if (!SkipSecurityCheckScope.IsActive) { // Check rights if (!TimeTrackingBlock.CheckUserRight(blockId, Security.RightWrite)) { throw new AccessDeniedException(); } } // O.R. [2008-08-04]: If finances are registered, set TotalApproved for new entries to zero. // So we can see the differences in the "Accounts" tab of info popup TimeTrackingBlock block = MetaObjectActivator.CreateInstance <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), blockId); if ((bool)block.Properties["AreFinancesRegistered"].Value && this.Properties["TotalApproved"].Value == null) { this.Properties["TotalApproved"].Value = 0; } base.OnSaving(); }
public TimeTrackingBlock(CustomTableRow row) : base(TimeTrackingBlock.GetAssignedMetaClass(), row) { }
public TimeTrackingBlock(CustomTableRow row, MetaObjectOptions options) : base(TimeTrackingBlock.GetAssignedMetaClass(), row, options) { }
public TimeTrackingBlock(PrimaryKeyId primaryKeyId) : base(TimeTrackingBlock.GetAssignedMetaClass(), primaryKeyId) { }
public TimeTrackingBlock(PrimaryKeyId primaryKeyId, MetaObjectOptions options) : base(TimeTrackingBlock.GetAssignedMetaClass(), primaryKeyId, options) { }
public TimeTrackingBlock() : base(TimeTrackingBlock.GetAssignedMetaClass()) { }
public TimeTrackingBlock(MetaObjectOptions options) : base(TimeTrackingBlock.GetAssignedMetaClass(), options) { }
public static int GetTotalCount(params FilterElement[] filters) { return(MetaObject.GetTotalCount(TimeTrackingBlock.GetAssignedMetaClass(), filters)); }
public static TimeTrackingBlock[] List(Mediachase.Ibn.Data.FilterElementCollection filters, Mediachase.Ibn.Data.SortingElementCollection sorting, int start, int count) { return(MetaObject.List <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), filters, sorting, start, count)); }
public static TimeTrackingBlock[] List(params Mediachase.Ibn.Data.SortingElement[] sorting) { return(MetaObject.List <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), sorting)); }
public static TimeTrackingBlock[] List(params Mediachase.Ibn.Data.FilterElement[] filters) { return(MetaObject.List <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass(), filters)); }
public static TimeTrackingBlock[] List() { return(MetaObject.List <TimeTrackingBlock>(TimeTrackingBlock.GetAssignedMetaClass())); }