github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/pkg/schemadsl/parser/tests/doccomments.zed (about)

     1  /**
     2   * user represents a user that can be granted role(s)
     3   */
     4  definition user {}
     5  
     6  /**
     7   * document represents a document protected by Authzed.
     8   */
     9  definition document {
    10      /**
    11       * writer indicates that the user is a writer on the document.
    12       */
    13      relation writer: user
    14  
    15      /**
    16       * reader indicates that the user is a reader on the document.
    17       */
    18      relation reader: user
    19  
    20      /**
    21       * edit indicates that the user has permission to edit the document.
    22       */
    23      permission edit = writer
    24  
    25      /**
    26       * view indicates that the user has permission to view the document, if they
    27       * are a `reader` *or* have `edit` permission.
    28       */
    29      permission view = reader + edit
    30  }