Nullinside.Api.Common
and Nullinside.Api.Common.AspNetCore
You get weird class conflicts when you import both the swagger version of AspNetCore and the latest version of EntityFrameworkCore. I could have worked through these by pulling in more granular packages but at the end of the day it's actually more "correct" to explicitly segregate on the line of "common functions added for this other library." So that's the evil I chose!
There are currently two roles defined in Nullinside.Api.Model.Ddl.UserRoles
:
User
: The role given to everyone.Admin
: The administrator role for the development team.VmAdmin
: Allows access to virtual machine management.By default, all users are given the User
role and all endpoints are configured to restrict access to someone with
the User
role.
To provide public, unauthenticated, access to endpoints add the [AllowAnonymous]
attribute.
To restrict endpoint access to a non-User
role decorate it with an attribute like the
following: [Authorize(nameof(AuthRoles.Admin))]
Nullinside.Api.Model.Ddl.UserRoles
class with the new role name.Names are imported dynamically. Every name in the UserRoles
enum will be converted to a role at runtime.
.SaveChangesAsync()
.ValueGeneratedOnAdd()
, .ValueGeneratedOnAddOrUpdate()
,
or .ValueGeneratedOnUpdate()
in the modeling POCOs.UPDATE
on
an unrelated field in the POCO and call .SaveChangesAsync()
.;AllowUserVariables=true
to your connection string.