Skip to content

Commit

Permalink
FEAT: add User Roles for SSO_DTO
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasBuscarini committed Jun 5, 2024
1 parent 5735ae1 commit 03468b4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build, Test, and Publish NuGet
uses: wahinekai/actions-publish-nuget@v3.0.1
with:
version: 1.0.15
version: 1.1.0
project-path: FoodService.Models/FoodService.Models.csproj
solution-path: FoodService.Models.sln
nuget-feed-password: ${{ secrets.PACKAGES_TOKEN }}
21 changes: 20 additions & 1 deletion FoodService.Models/Dto/SsoDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,36 @@ public class SsoDto
/// </summary>
public UserBase User { get; set; }

/// <summary>
/// Gets or sets the user roles
/// </summary>
public List<string> Roles { get; set; }

/// <summary>
/// Initializes a new instance of the <see cref="SsoDto"/> class.
/// </summary>
/// <param name="accessToken">The access token.</param>
/// <param name="user">The user information.</param>\
/// <param name="expiration">The expiration datetime.</param>\
public SsoDto(string accessToken, UserBase user, DateTime expiration)
public SsoDto(string accessToken, UserBase user, DateTime expiration, List<string> roles)
{
AccessToken = accessToken;
User = user;
Expiration = expiration;
Roles = roles;
}

/// <summary>
/// Initializes a new instance of the <see cref="SsoDto"/> class.
/// </summary>
/// <param name="accessToken">The access token.</param>
/// <param name="user">The user information.</param>
public SsoDto(string accessToken, UserBase user, List<string> roles)
{
AccessToken = accessToken;
User = user;
Expiration = DateTime.UtcNow.AddHours(3);
Roles = roles;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion FoodService.Models/FoodService.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>FoodService.Models</PackageId>
<Version>1.0.15</Version>
<Version>1.1.0</Version>
<Authors>FoodService</Authors>
<Company>FoodService</Company>
<PackageDescription>A library for models in FoodService project</PackageDescription>
Expand Down

0 comments on commit 03468b4

Please sign in to comment.