diff --git a/samples/Fga.Example.AspNetCore/Controllers/DocumentController.cs b/samples/Fga.Example.AspNetCore/Controllers/DocumentController.cs index 792cb77..2335972 100644 --- a/samples/Fga.Example.AspNetCore/Controllers/DocumentController.cs +++ b/samples/Fga.Example.AspNetCore/Controllers/DocumentController.cs @@ -10,18 +10,32 @@ namespace Fga.Example.AspNetCore.Controllers; [Authorize(FgaAuthorizationDefaults.PolicyKey)] public class DocumentController : ControllerBase { + [HttpGet("view/{documentId}")] - [FgaRouteObject("viewer","doc", "documentId")] + [FgaRouteObject(Fga.Document.Viewer, Fga.Document.Type, "documentId")] public string GetByConvention(string documentId) { return documentId; } [HttpGet] - [FgaString("anne", "read", "doc:Z")] + [FgaString("anne", "viewer", "document:12345")] public string GetHardcoded() { return string.Empty; } +} + +public static class Fga +{ + public class Document + { + public const string Type = "document"; + + public const string Viewer = "viewer"; + public const string Editor = "editor"; + public const string Owner = "owner"; + + } } \ No newline at end of file