public ItemRoles(SPWeb web, IItemLocator itemLocator, string listLocation, string itemName, IEnumerable <GroupRolePair> groupRolePairs, bool shouldCopyParentRolesWhenBreakingInheritance = true) : base(shouldCopyParentRolesWhenBreakingInheritance) { this.Web = web; this.SecurableObjectLocation = listLocation; this.itemName = itemName; this.itemLocator = itemLocator; this.GroupRolePairs.Clear(); this.GroupRolePairs.AddRange(groupRolePairs); }
public ItemRoles(SPWeb web, IItemLocator itemLocator, string listLocation, string itemName, IEnumerable<GroupRolePair> groupRolePairs, bool shouldCopyParentRolesWhenBreakingInheritance = true) : base(shouldCopyParentRolesWhenBreakingInheritance) { this.Web = web; this.SecurableObjectLocation = listLocation; this.itemName = itemName; this.itemLocator = itemLocator; this.GroupRolePairs.Clear(); this.GroupRolePairs.AddRange(groupRolePairs); }
private IEnumerable <FilterInstruction> GetFilterInstructions(RestItemData itemData) { foreach (string fieldName in itemData.Keys) { IItemLocator <TNav> locator = _subContext.Fields.GetLocator(fieldName); if (locator == null) { continue; } string findValue = itemData[fieldName].ToString(); // todo currently converts from int only to be parsed back later yield return(new FilterInstruction(fieldName, FilterComparisonOperator.Equals, findValue)); } }
/// <summary> /// Attempts to locate the item to modify using the modification request data. /// </summary> internal DeferredItemBase <TNav> LocateItem(IEngineRepository <TNav> navRepository, RestItemData itemData) { foreach (string fieldName in itemData.Keys) { // TODO implicit & explicit location option e.g. { "*id": 123 } IItemLocator <TNav> locator = _subContext.Fields.GetLocator(fieldName); if (locator != null) { object findValue = itemData[fieldName]; TNav locatedItem = locator.TryLocateItem(navRepository, findValue); if (locatedItem != null) { itemData.Remove(fieldName); // remove so we don't write to this value later. return(new LoadedItem <TNav>(locatedItem)); } } } return(null); }