appendix: 23 Code-Ausschnitte aus dem Houston-Repository
Pin nixpkgs to the revision used by itc.componentware: the channel version ships a latexminted that crashes on Python 3.14, which made every listing fail and sent latexmk into an endless error prompt. Also force nonstopmode/halt-on-error so a broken listing can never loop again.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// Houston/Auth/HoustonRoles.cs
|
||||
public static readonly string DocumentsView = "Documents.View";
|
||||
|
||||
// Houston/Program.cs
|
||||
var viewDocumentsPolicy = "CanViewDocuments";
|
||||
|
||||
builder.Services.AddAuthorization(o =>
|
||||
{
|
||||
o.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
|
||||
// ...
|
||||
o.AddPolicy(viewDocumentsPolicy, policy => policy.RequireRole(HoustonRoles.DocumentsView));
|
||||
});
|
||||
|
||||
builder.Services.AddRazorPages(o =>
|
||||
{
|
||||
// ...
|
||||
o.Conventions.AllowAnonymousToPage("/Document/Share");
|
||||
o.Conventions.AuthorizeFolder("/Document", viewDocumentsPolicy);
|
||||
o.Conventions.AuthorizePage("/Documents", viewDocumentsPolicy);
|
||||
});
|
||||
|
||||
// Houston/Services registrations
|
||||
builder.Services.AddOptions<DocumentsSettings>().BindConfiguration("Documents");
|
||||
builder.Services.AddDocumentsClient();
|
||||
builder.Services.AddScoped<DocumentsService>();
|
||||
Reference in New Issue
Block a user