((META (EMPTY-STRING title "Visibility rules for zettel") (WORD role "manual") (TAG-SET tags ("#authorization" "#configuration" "#manual" "#security" "#zettelstore")) (WORD syntax "zmk") (ZID-SET back ("00001010000000" "00001010070300" "00001012051200" "00001012921200" "00001017000000")) (ZID-SET backward ("00001004020000" "00001006020000" "00001010000000" "00001010070300" "00001012051200" "00001012921200" "00001017000000")) (NUMBER box-number "1") (STRING copyright "(c) 2020-present by Detlef Stern ") (TIMESTAMP created "20210126175322") (ZID-SET forward ("00000000000004" "00000000020001" "00000000040001" "00001004010000" "00001004020000" "00001006020000" "00001006030500" "00001007700000" "00001010040100" "00001014000000")) (WORD lang "en") (EMPTY-STRING license "EUPL-1.2-or-later") (TIMESTAMP modified "20220923104643") (TIMESTAMP published "20220923104643") (WORD visibility "public")) (BLOCK (PARA (TEXT "For every zettel you can specify under which condition the zettel is visible to others.") (SOFT) (TEXT "This is controlled with the metadata key ") (LINK-ZETTEL () "00001006020000#visibility" (LITERAL-INPUT () "visibility")) (TEXT ".") (SOFT) (TEXT "The following values are supported:")) (DESCRIPTION ((MARK "public" "public" "public" (FORMAT-QUOTE () (TEXT "public")))) (BLOCK (BLOCK (PARA (TEXT "The zettel is visible to everybody, even if the user is not authenticated.")))) ((MARK "login" "login" "login" (FORMAT-QUOTE () (TEXT "login")))) (BLOCK (BLOCK (PARA (TEXT "Only an authenticated user can access the zettel.")) (PARA (TEXT "This is the default value for ") (LINK-ZETTEL () "00001004020000#default-visibility" (LITERAL-INPUT () "default-visibility")) (TEXT ".")))) ((MARK "creator" "creator" "creator" (FORMAT-QUOTE () (TEXT "creator")))) (BLOCK (BLOCK (PARA (TEXT "Only an authenticated user that is allowed to create new zettel can access the zettel.")))) ((MARK "owner" "owner" "owner" (FORMAT-QUOTE () (TEXT "owner")))) (BLOCK (BLOCK (PARA (TEXT "Only the owner of the Zettelstore can access the zettel.")) (PARA (TEXT "This is for zettel with sensitive content, e.g. the ") (LINK-ZETTEL () "00001004020000" (TEXT "configuration zettel")) (TEXT " or the various zettel that contains the templates for rendering zettel in HTML.")))) ((MARK "expert" "expert" "expert" (FORMAT-QUOTE () (TEXT "expert")))) (BLOCK (BLOCK (PARA (TEXT "Only the owner of the Zettelstore can access the zettel, if runtime configuration ") (LINK-ZETTEL () "00001004020000#expert-mode" (LITERAL-INPUT () "expert-mode")) (TEXT " is set to a ") (LINK-ZETTEL () "00001006030500" (TEXT "boolean true value")) (TEXT ".")) (PARA (TEXT "This is for zettel with sensitive content that might irritate the owner.") (SOFT) (TEXT "Computed zettel with internal runtime information are examples for such a zettel."))))) (PARA (TEXT "When you install a Zettelstore, only ") (LINK-QUERY () "visibility:public" (TEXT "some zettel")) (TEXT " have visibility ") (FORMAT-QUOTE () (TEXT "public")) (TEXT ".") (SOFT) (TEXT "One is the zettel that contains ") (LINK-ZETTEL () "00000000020001" (TEXT "CSS")) (TEXT " for displaying the ") (LINK-ZETTEL () "00001014000000" (TEXT "web user interface")) (TEXT ".") (SOFT) (TEXT "This is to ensure that the web interface looks nice even for not authenticated users.") (SOFT) (TEXT "Another is the zettel containing the Zettelstore ") (LINK-ZETTEL () "00000000000004" (TEXT "license")) (TEXT ".") (SOFT) (TEXT "The ") (LINK-ZETTEL () "00000000040001" (TEXT "default image")) (TEXT ", used if an image reference is invalid, is also public visible.")) (PARA (TEXT "Please note: if ") (LINK-ZETTEL () "00001010040100" (TEXT "authentication is not enabled")) (TEXT ", every user has the same rights as the owner of a Zettelstore.") (SOFT) (TEXT "This is also true, if the Zettelstore runs additionally in ") (LINK-ZETTEL () "00001004010000#read-only-mode" (TEXT "read-only mode")) (TEXT ".") (SOFT) (TEXT "In this case, the ") (LINK-ZETTEL () "00001004020000" (TEXT "runtime configuration zettel")) (TEXT " is shown (its visibility is ") (FORMAT-QUOTE () (TEXT "owner")) (TEXT ").") (SOFT) (TEXT "The ") (LINK-ZETTEL () "00001004010000" (TEXT "startup configuration")) (TEXT " is not shown, because the associated computed zettel with identifier ") (LITERAL-INPUT () "00000000000096") (TEXT " is stored with the visibility ") (FORMAT-QUOTE () (TEXT "expert")) (TEXT ".") (SOFT) (TEXT "If you want to show such a zettel, you must set ") (LITERAL-INPUT () "expert-mode") (TEXT " to true.")) (HEADING 1 () "examples" "examples" (TEXT "Examples")) (PARA (TEXT "By using a ") (LINK-ZETTEL () "00001007700000" (TEXT "query expression")) (TEXT ", you can easily create a zettel list based on the ") (LITERAL-INPUT () "visibility") (TEXT " metadata key:")) (TABLE () ((CELL (TEXT "public")) (CELL (LINK-QUERY () "visibility:public" (TEXT "visibility:public")))) ((CELL (TEXT "login")) (CELL (LINK-QUERY () "visibility:login" (TEXT "visibility:login")))) ((CELL (TEXT "creator")) (CELL (LINK-QUERY () "visibility:creator" (TEXT "visibility:creator")))) ((CELL (TEXT "owner")) (CELL (LINK-QUERY () "visibility:owner" (TEXT "visibility:owner")))) ((CELL (TEXT "expert")) (CELL (LINK-QUERY () "visibility:expert" (TEXT "visibility:expert")) (ENDNOTE () (TEXT "Only if ") (LINK-ZETTEL () "00001004020000#expert-mode" (LITERAL-INPUT () "expert-mode")) (TEXT " is enabled, this list will show some zettel.")))))))