53 return databaseContext
74 authenticationContext,
91 .Where(
x =>
x.Id ==
id)
121 .Include(
x =>
x.Users)
122 .Include(
x =>
x.PermissionSet);
153 Logger.LogInformation(
"Created new user group {groupName} ({groupId})",
dbGroup.Name,
dbGroup.Id);
166 .Where(
x =>
x.Id ==
id)
167 .Include(
x =>
x.PermissionSet)
192 .Where(
x =>
x.Id ==
id &&
x.Users!.Count == 0)
202 .Where(
x =>
x.Id ==
id)
Represents a set of server permissions.
AdministrationRights? AdministrationRights
The Rights.AdministrationRights for the user.
Represents an error message returned by the server.
Base implementation of IAuthority.
ILogger< AuthorityBase > Logger
Gets the ILogger for the AuthorityBase.
Represents a response from an authority.
IQueryable< UserGroup > Queryable(bool includeJoins)
Gets all registered UserGroups.A IQueryable<T> of UserGroups.
ValueTask< AuthorityResponse< UserGroup > > Read()
Gets the current UserGroup.A ValueTask<TResult> resulting in a UserGroup AuthorityResponse<TResult>.
UserGroupAuthority(IAuthenticationContext authenticationContext, IDatabaseContext databaseContext, ILogger< UserGroupAuthority > logger, IUserGroupsDataLoader userGroupsDataLoader, IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Initializes a new instance of the UserGroupAuthority class.
async ValueTask< AuthorityResponse< UserGroup > > GetId(long id, bool includeJoins, CancellationToken cancellationToken)
Gets the UserGroup with a given id .A ValueTask<TResult> resulting in a User AuthorityResponse<TResul...
readonly IUserGroupsDataLoader userGroupsDataLoader
The IUserGroupsDataLoader for the UserGroupAuthority.
async ValueTask< AuthorityResponse > DeleteEmpty(long id, CancellationToken cancellationToken)
Deletes an empty UserGroup.A ValueTask representing the running operation.
static Task< Dictionary< long, UserGroup > > GetUserGroups(IReadOnlyList< long > ids, IDatabaseContext databaseContext, CancellationToken cancellationToken)
Implements the userGroupsDataLoader.
async ValueTask< AuthorityResponse< UserGroup > > Update(long id, string? newName, Models.PermissionSet? newPermissionSet, CancellationToken cancellationToken)
Updates a UserGroup.A ValueTask<TResult> resulting in a UserGroup AuthorityResponse<TResult>.
async ValueTask< AuthorityResponse< UserGroup > > Create(string name, Models.PermissionSet? permissionSet, CancellationToken cancellationToken)
Create a UserGroup.A ValueTask<TResult> resulting in a UserGroup AuthorityResponse<TResult>.
readonly IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions
The IOptionsSnapshot<TOptions> of the GeneralConfiguration.
Backend abstract implementation of IDatabaseContext.
Task Save(CancellationToken cancellationToken)
Saves changes made to the IDatabaseContext.A Task representing the running operation.
DbSet< UserGroup > Groups
The UserGroups in the DatabaseContext.
Represents a group of Users.
long? GroupId
The EntityId.Id of the User's Group.
UserGroup? Group
The UserGroup the User belongs to, if any.
User User
The authenticated user.
ulong GetRight(RightsType rightsType)
Get the value of a given rightsType .The value of rightsType . Note that if InstancePermissionSet is ...
IAuthority for managing UserGroups.
IDatabaseCollection< UserGroup > Groups
The DbSet<TEntity> for UserGroups.
For creating and accessing authentication contexts.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
@ List
User may list files if the Models.Instance allows it.
RightsType
The type of rights a model uses.
InstanceManagerRights
Rights for managing Models.Instances.
AdministrationRights
Administration rights for the server.
HttpFailureResponse
Indicates the type of HTTP status code an failing AuthorityResponse should generate.
HttpSuccessResponse
Indicates the type of HTTP status code a successful AuthorityResponse<TResult> should generate.