Skip to content

Commit

Permalink
Adjust model properties (#12)
Browse files Browse the repository at this point in the history
* Add MentoredUserIds to Membership
Remove AddressId
Make GetMemberships call return User as well

* Update permissions

* Update spacing
  • Loading branch information
ninjapiratica authored Dec 8, 2024
1 parent 23586c1 commit 0fa7708
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 206 deletions.
51 changes: 51 additions & 0 deletions NP.Lti13Platform.Core/Models/CustomPermissions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace NP.Lti13Platform.Core.Models
{
public class CustomPermissions
{
public bool UserId { get; set; }
public bool UserImage { get; set; }
public bool UserUsername { get; set; }
public bool UserOrg { get; set; }
public bool UserScopeMentor { get; set; }
public bool UserGradeLevelsOneRoster { get; set; }

public bool ActualUserId { get; set; }
public bool ActualUserImage { get; set; }
public bool ActualUserUsername { get; set; }
public bool ActualUserOrg { get; set; }
public bool ActualUserScopeMentor { get; set; }
public bool ActualUserGradeLevelsOneRoster { get; set; }

public bool ContextId { get; set; }
public bool ContextOrg { get; set; }
public bool ContextType { get; set; }
public bool ContextLabel { get; set; }
public bool ContextTitle { get; set; }
public bool ContextSourcedId { get; set; }
public bool ContextIdHistory { get; set; }
public bool ContextGradeLevelsOneRoster { get; set; }

public bool ResourceLinkId { get; set; }
public bool ResourceLinkTitle { get; set; }
public bool ResourceLinkDescription { get; set; }
public bool ResourceLinkAvailableStartDateTime { get; set; }
public bool ResourceLinkAvailableUserStartDateTime { get; set; }
public bool ResourceLinkAvailableEndDateTime { get; set; }
public bool ResourceLinkAvailableUserEndDateTime { get; set; }
public bool ResourceLinkSubmissionStartDateTime { get; set; }
public bool ResourceLinkSubmissionUserStartDateTime { get; set; }
public bool ResourceLinkSubmissionEndDateTime { get; set; }
public bool ResourceLinkSubmissionUserEndDateTime { get; set; }
public bool ResourceLinkLineItemReleaseDateTime { get; set; }
public bool ResourceLinkLineItemUserReleaseDateTime { get; set; }
public bool ResourceLinkIdHistory { get; set; }

public bool ToolPlatformProductFamilyCode { get; set; }
public bool ToolPlatformProductVersion { get; set; }
public bool ToolPlatformProductInstanceGuid { get; set; }
public bool ToolPlatformProductInstanceName { get; set; }
public bool ToolPlatformProductInstanceDescription { get; set; }
public bool ToolPlatformProductInstanceUrl { get; set; }
public bool ToolPlatformProductInstanceContactEmail { get; set; }
}
}
2 changes: 2 additions & 0 deletions NP.Lti13Platform.Core/Models/Membership.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class Membership
public required MembershipStatus Status { get; set; }

public required IEnumerable<string> Roles { get; set; }

public required IEnumerable<string> MentoredUserIds { get; set; }
}

public enum MembershipStatus
Expand Down
82 changes: 0 additions & 82 deletions NP.Lti13Platform.Core/Models/Tool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,87 +19,5 @@ public class Tool
public IDictionary<string, string>? Custom { get; set; }

public IEnumerable<string> ServiceScopes { get; set; } = [];

public required UserPermissions UserPermissions { get; set; }

public required CustomPermissions CustomPermissions { get; set; }
}

public class UserPermissions
{
public bool Address { get; set; }
public bool AddressCountry { get; set; }
public bool AddressFormatted { get; set; }
public bool AddressLocality { get; set; }
public bool AddressPostalCode { get; set; }
public bool AddressRegion { get; set; }
public bool AddressStreetAddress { get; set; }
public bool Birthdate { get; set; }
public bool Email { get; set; }
public bool EmailVerified { get; set; }
public bool FamilyName { get; set; }
public bool Gender { get; set; }
public bool GivenName { get; set; }
public bool Locale { get; set; }
public bool MiddleName { get; set; }
public bool Name { get; set; }
public bool Nickname { get; set; }
public bool PhoneNumber { get; set; }
public bool PhoneNumberVerified { get; set; }
public bool Picture { get; set; }
public bool PreferredUsername { get; set; }
public bool Profile { get; set; }
public bool UpdatedAt { get; set; }
public bool Website { get; set; }
public bool TimeZone { get; set; }
}

public class CustomPermissions
{
public bool UserId { get; set; }
public bool UserImage { get; set; }
public bool UserUsername { get; set; }
public bool UserOrg { get; set; }
public bool UserScopeMentor { get; set; }
public bool UserGradeLevelsOneRoster { get; set; }

public bool ActualUserId { get; set; }
public bool ActualUserImage { get; set; }
public bool ActualUserUsername { get; set; }
public bool ActualUserOrg { get; set; }
public bool ActualUserScopeMentor { get; set; }
public bool ActualUserGradeLevelsOneRoster { get; set; }

public bool ContextId { get; set; }
public bool ContextOrg { get; set; }
public bool ContextType { get; set; }
public bool ContextLabel { get; set; }
public bool ContextTitle { get; set; }
public bool ContextSourcedId { get; set; }
public bool ContextIdHistory { get; set; }
public bool ContextGradeLevelsOneRoster { get; set; }

public bool ResourceLinkId { get; set; }
public bool ResourceLinkTitle { get; set; }
public bool ResourceLinkDescription { get; set; }
public bool ResourceLinkAvailableStartDateTime { get; set; }
public bool ResourceLinkAvailableUserStartDateTime { get; set; }
public bool ResourceLinkAvailableEndDateTime { get; set; }
public bool ResourceLinkAvailableUserEndDateTime { get; set; }
public bool ResourceLinkSubmissionStartDateTime { get; set; }
public bool ResourceLinkSubmissionUserStartDateTime { get; set; }
public bool ResourceLinkSubmissionEndDateTime { get; set; }
public bool ResourceLinkSubmissionUserEndDateTime { get; set; }
public bool ResourceLinkLineItemReleaseDateTime { get; set; }
public bool ResourceLinkLineItemUserReleaseDateTime { get; set; }
public bool ResourceLinkIdHistory { get; set; }

public bool ToolPlatformProductFamilyCode { get; set; }
public bool ToolPlatformProductVersion { get; set; }
public bool ToolPlatformProductInstanceGuid { get; set; }
public bool ToolPlatformProductInstanceName { get; set; }
public bool ToolPlatformProductInstanceDescription { get; set; }
public bool ToolPlatformProductInstanceUrl { get; set; }
public bool ToolPlatformProductInstanceContactEmail { get; set; }
}
}
2 changes: 0 additions & 2 deletions NP.Lti13Platform.Core/Models/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public class User

public class Address
{
public required string Id { get; set; }

public string? Formatted { get; set; }

public string? StreetAddress { get; set; }
Expand Down
31 changes: 31 additions & 0 deletions NP.Lti13Platform.Core/Models/UserPermissions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace NP.Lti13Platform.Core.Models
{
public class UserPermissions
{
public bool Address { get; set; }
public bool AddressCountry { get; set; }
public bool AddressFormatted { get; set; }
public bool AddressLocality { get; set; }
public bool AddressPostalCode { get; set; }
public bool AddressRegion { get; set; }
public bool AddressStreetAddress { get; set; }
public bool Birthdate { get; set; }
public bool Email { get; set; }
public bool EmailVerified { get; set; }
public bool FamilyName { get; set; }
public bool Gender { get; set; }
public bool GivenName { get; set; }
public bool Locale { get; set; }
public bool MiddleName { get; set; }
public bool Name { get; set; }
public bool Nickname { get; set; }
public bool PhoneNumber { get; set; }
public bool PhoneNumberVerified { get; set; }
public bool Picture { get; set; }
public bool PreferredUsername { get; set; }
public bool Profile { get; set; }
public bool UpdatedAt { get; set; }
public bool Website { get; set; }
public bool TimeZone { get; set; }
}
}
4 changes: 2 additions & 2 deletions NP.Lti13Platform.Core/NP.Lti13Platform.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.3.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 0fa7708

Please sign in to comment.