[CHANGE] Updated models

This commit is contained in:
max 2025-01-08 16:30:51 +01:00
parent fd733b7238
commit 3ccd3106c1
3 changed files with 23 additions and 7 deletions

View File

@ -19,8 +19,16 @@ public partial class AuthorityManager
return Result<AuthorityRole>.Failed("Not implemented!"); return Result<AuthorityRole>.Failed("Not implemented!");
} }
public async Task AddUserToRole(AuthorityUser user, AuthorityRole role, CancellationToken? cancellationToken = null) public async Task AddRoleToUserAsync(AuthorityUser user, AuthorityRole role, CancellationToken? cancellationToken = null)
{ {
} }
public async Task RemoveRoleFromUserAsync(AuthorityRole role, AuthorityUser user, CancellationToken? cancellationToken = null)
{
}
public async Task AddRoleToGroupAsync(AuthorityRole role, AuthorityGroup group, CancellationToken? cancellationToken = null)
{
}
} }

View File

@ -1,6 +1,6 @@
namespace DotBased.AspNet.Authority.Models.Authority; namespace DotBased.AspNet.Authority.Models.Authority;
public class AuthorityGroup : AuthorityGroup<Guid> public class AuthorityGroup
{ {
public AuthorityGroup(string name) : this() public AuthorityGroup(string name) : this()
{ {
@ -12,11 +12,8 @@ public class AuthorityGroup : AuthorityGroup<Guid>
Id = Guid.NewGuid(); Id = Guid.NewGuid();
CreatedDate = DateTime.Now; CreatedDate = DateTime.Now;
} }
}
public Guid Id { get; set; }
public abstract class AuthorityGroup<TKey> where TKey : IEquatable<TKey>
{
public TKey Id { get; set; }
public string? Name { get; set; } public string? Name { get; set; }

View File

@ -2,6 +2,17 @@ namespace DotBased.AspNet.Authority.Models.Authority;
public abstract class AuthorityRole public abstract class AuthorityRole
{ {
public AuthorityRole(string name) : this()
{
Name = name;
}
public AuthorityRole()
{
Id = Guid.NewGuid();
CreatedDate = DateTime.Now;
}
public Guid Id { get; set; } public Guid Id { get; set; }
public string? Name { get; set; } public string? Name { get; set; }