/// <summary> /// This function copies the local Roles to URM roles. This is a little different from the CopyToLocalRole method since URM.Role.Include/Exclude is readonly. /// </summary> /// <param name="role"></param> /// <returns></returns> private URM.Role CopyToURMRole(Role role) { URM.Role r = new URM.Role(); r.Description = role.Description; r.ExtraData = role.ExtraData; r.Guid = role.Guid; r.IsDynamic = role.IsDynamic; r.Name = role.Name; SetRoleItems(r.Include, role.Includes); SetRoleItems(r.Exclude, role.Excludes); return r; }
/// <summary> /// This function takes the K2 URM role and copies it to a local object that is serializable. /// This also invokes the GetRolesItems on the includes and excludes. /// </summary> /// <param name="urmRole">The K2 URM role to copy.</param> /// <returns>The local role</returns> private Role CopyToLocalRole(URM.Role urmRole) { Role r = new Role(); r.Description = urmRole.Description; r.ExtraData = urmRole.ExtraData; r.Guid = urmRole.Guid; r.IsDynamic = urmRole.IsDynamic; r.Name = urmRole.Name; r.Includes = this.CopyRoleItems(urmRole.Include); r.Excludes = this.CopyRoleItems(urmRole.Exclude); return r; }