diff options
author | crupest <crupest@outlook.com> | 2020-11-13 16:20:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 16:20:45 +0800 |
commit | 381cb7c64123c71899f549baa16bb610cc8b037f (patch) | |
tree | dfb4dd690704e887e3609265e6a652fe7ccea218 /BackEnd/Timeline/Entities/UserEntity.cs | |
parent | 5b78017e93450342c85a0e7f5ed16bbb6ae8422e (diff) | |
parent | b635b4453756d9a33c173c9b9f2ae0ab7c830d3b (diff) | |
download | timeline-381cb7c64123c71899f549baa16bb610cc8b037f.tar.gz timeline-381cb7c64123c71899f549baa16bb610cc8b037f.tar.bz2 timeline-381cb7c64123c71899f549baa16bb610cc8b037f.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.cs | 14 |
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
}
}
|