redo
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using back.DTO;
|
||||
using MCVIngenieros.Transactional.Abstractions.Interfaces;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Transactional.Abstractions.Interfaces;
|
||||
|
||||
namespace back.DataModels;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class User : IEntity<User>
|
||||
public UserDto ToDto() => new()
|
||||
{
|
||||
Id = Id,
|
||||
Roles = Roles
|
||||
Roles = [.. Roles.Select(r => r.ToDto())]
|
||||
};
|
||||
|
||||
public bool IsAdmin() => Roles.Any(r => r.IsAdmin());
|
||||
@@ -80,7 +80,7 @@ public class User : IEntity<User>
|
||||
password: "",
|
||||
createdAt: DateTime.UtcNow
|
||||
)
|
||||
{
|
||||
{
|
||||
Roles = [Role.AdminRole, Role.ContentManagerRole, Role.UserRole]
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user