aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Entities/UserEntity.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-13 16:20:45 +0800
committerGitHub <noreply@github.com>2020-11-13 16:20:45 +0800
commit299067a798077363d0df281fc3bfb4160df06e1f (patch)
tree9750c3e57d803efaa65a13c9c47886746d77d721 /BackEnd/Timeline/Entities/UserEntity.cs
parent0c789f235f38aa238048b31b9715810d397d3420 (diff)
parent79673878b5427bbedbc4ff4323dce3958d307b49 (diff)
downloadtimeline-299067a798077363d0df281fc3bfb4160df06e1f.tar.gz
timeline-299067a798077363d0df281fc3bfb4160df06e1f.tar.bz2
timeline-299067a798077363d0df281fc3bfb4160df06e1f.zip
Merge pull request #183 from crupest/auth
Refactor auth module to enable more flexiable permission control.
Diffstat (limited to 'BackEnd/Timeline/Entities/UserEntity.cs')
-rw-r--r--BackEnd/Timeline/Entities/UserEntity.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/BackEnd/Timeline/Entities/UserEntity.cs b/BackEnd/Timeline/Entities/UserEntity.cs
index 0cfaa335..6a256a31 100644
--- a/BackEnd/Timeline/Entities/UserEntity.cs
+++ b/BackEnd/Timeline/Entities/UserEntity.cs
@@ -5,13 +5,6 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Timeline.Entities
{
- public static class UserRoles
- {
- public const string Admin = "admin";
- public const string User = "user";
- }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "This is an entity class.")]
[Table("users")]
public class UserEntity
{
@@ -30,9 +23,6 @@ namespace Timeline.Entities
[Column("password"), Required]
public string Password { get; set; } = default!;
- [Column("roles"), Required]
- public string Roles { get; set; } = default!;
-
[Column("version"), Required]
public long Version { get; set; }
@@ -47,10 +37,14 @@ namespace Timeline.Entities
public UserAvatarEntity? Avatar { get; set; }
+#pragma warning disable CA2227 // Collection properties should be read only
+ public List<UserPermissionEntity> Permissions { get; set; } = default!;
+
public List<TimelineEntity> Timelines { get; set; } = default!;
public List<TimelinePostEntity> TimelinePosts { get; set; } = default!;
public List<TimelineMemberEntity> TimelinesJoined { get; set; } = default!;
+#pragma warning restore CA2227 // Collection properties should be read only
}
}