[CHANGE] Adding functionality to manager

This commit is contained in:
max
2025-04-06 21:34:40 +02:00
parent d6c0ad1138
commit d8b08a763e
17 changed files with 234 additions and 76 deletions

View File

@@ -1,12 +1,8 @@
namespace DotBased.AspNet.Authority.Models.Authority;
public class AuthorityAttribute(string attributeKey, Guid bound)
public class AuthorityAttribute(string attributeKey, Guid foreignKey)
{
public AuthorityAttribute() : this(string.Empty, Guid.NewGuid())
{
}
public Guid BoundId { get; set; } = bound;
public Guid ForeignKey { get; set; } = foreignKey;
public string AttributeKey { get; set; } = attributeKey;

View File

@@ -9,7 +9,7 @@ public class AuthorityRole()
public Guid Id { get; set; } = Guid.NewGuid();
public string? Name { get; set; }
public string Name { get; set; } = string.Empty;
public long Version { get; set; }
@@ -17,5 +17,5 @@ public class AuthorityRole()
public IEnumerable<AuthorityAttribute> Attributes { get; set; } = [];
public override string ToString() => Name ?? string.Empty;
public override string ToString() => Name;
}

View File

@@ -23,7 +23,7 @@ public class AuthorityResult<TResultValue> : Result<TResultValue>
public IReadOnlyList<ValidationError>? ValidationErrors { get; }
public static AuthorityResult<TResultValue> Ok(TResultValue? value) => new AuthorityResult<TResultValue>(true, value:value);
public new static AuthorityResult<TResultValue> Ok(TResultValue? value) => new AuthorityResult<TResultValue>(true, value:value);
public static AuthorityResult<TResultValue> Error(string errorMessage, ResultFailReason reason = ResultFailReason.Error) =>
new AuthorityResult<TResultValue>(false, errorMessage, reason:reason);