60 return databaseContext
104 .Where(
x =>
x.Id ==
id)
125 .Where(user => user.Id ==
userId)
126 .Select(user => user.Group)
170 Logger.LogInformation(
"Created new user group {groupName} ({groupId})",
dbGroup.Name,
dbGroup.Id);
187 .Where(
x =>
x.Id ==
id)
188 .Include(
x =>
x.PermissionSet)
216 .Where(
x =>
x.Id ==
id &&
x.Users!.Count == 0)
226 .Where(
x =>
x.Id ==
id)
251 .Include(
x =>
x.Users)
252 .Include(
x =>
x.PermissionSet);
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.
Evaluates a set of IAuthorizationRequirements to be checked before executing a response.
readonly IClaimsPrincipalAccessor claimsPrincipalAccessor
The IClaimsPrincipalAccessor for the UserGroupAuthority.
IQueryable< UserGroup > QueryableImpl(bool includeJoins)
Get the IQueryable<T> UserGroups.
RequirementsGated< AuthorityResponse< UserGroup > > Update(long id, string? newName, Models.PermissionSet? newPermissionSet, CancellationToken cancellationToken)
Updates a UserGroup.A ValueTask<TResult> resulting in a RequirementsGated<TResult> UserGroup Authorit...
RequirementsGated< AuthorityResponse< UserGroup > > Create(string name, Models.PermissionSet? permissionSet, CancellationToken cancellationToken)
Create a UserGroup.A RequirementsGated<TResult> UserGroup AuthorityResponse<TResult>.
RequirementsGated< IQueryable< UserGroup > > Queryable(bool includeJoins)
Gets all registered UserGroups.A RequirementsGated<TResult> IQueryable<T> of UserGroups.
readonly IUserGroupsDataLoader userGroupsDataLoader
The IUserGroupsDataLoader for the UserGroupAuthority.
static Task< Dictionary< long, UserGroup > > GetUserGroups(IReadOnlyList< long > ids, IDatabaseContext databaseContext, CancellationToken cancellationToken)
Implements the userGroupsDataLoader.
readonly IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions
The IOptionsSnapshot<TOptions> of the GeneralConfiguration.
RequirementsGated< AuthorityResponse< UserGroup > > GetId(long id, bool includeJoins, CancellationToken cancellationToken)
Gets the UserGroup with a given id .A RequirementsGated<TResult> User AuthorityResponse<TResult>.
RequirementsGated< AuthorityResponse< UserGroup > > Read(CancellationToken cancellationToken)
Gets the current UserGroup.A ValueTask<TResult> resulting in a UserGroup AuthorityResponse<TResult>.
RequirementsGated< AuthorityResponse > DeleteEmpty(long id, CancellationToken cancellationToken)
Deletes an empty UserGroup.A RequirementsGated<TResult> AuthorityResponse representing the running op...
UserGroupAuthority(IDatabaseContext databaseContext, ILogger< UserGroupAuthority > logger, IUserGroupsDataLoader userGroupsDataLoader, IClaimsPrincipalAccessor claimsPrincipalAccessor, IOptionsSnapshot< GeneralConfiguration > generalConfigurationOptions)
Initializes a new instance of the UserGroupAuthority class.
Backend abstract implementation of IDatabaseContext.
Task Save(CancellationToken cancellationToken)
Saves changes made to the IDatabaseContext.A Task representing the running operation.
DbSet< User > Users
The Users in the DatabaseContext.
DbSet< UserGroup > Groups
The UserGroups in the DatabaseContext.
Represents a group of Users.
IAuthority for managing UserGroups.
IDatabaseCollection< UserGroup > Groups
The DbSet<TEntity> for UserGroups.
Interface for accessing the current request's ClaimsPrincipal.
ClaimsPrincipal User
Get the current ClaimsPrincipal.
ErrorCode
Types of Response.ErrorMessageResponses that the API may return.
@ List
User may list files if the Models.Instance allows it.
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.