#1229 document reason strings in policies
Merged 5 years ago by mikem. Opened 5 years ago by tkopecek.
tkopecek/koji issue1228  into  master

@@ -67,7 +67,7 @@ 

              operation move :: {

                  fromtag *-updates-candidate :: allow

                  fromtag *-updates-testing :: allow

-                 all :: deny

+                 all :: deny Tagging from some tags to *-updates is forbidden.

              }

              operation tag && hastag *-updates-candidate *-updates-testing :: deny

          }
@@ -84,6 +84,11 @@ 

  or ``*-updates-testing``. Conversely, a basic tag operation (not a move) is

  denied if the build also has such a tag (the policy requires a move instead).

  

+ For denied operations some clarifying message is sent to user. If there is no

+ specific message (everything after action keyword), only generic 'policy

+ violation (policy_name)' is sent, so it could be helpful to specify such

+ messages in more complicated cases.

+ 

  General format

  ==============

  The general form of a basic policy line is one of the following

-    test [params] [&& test [params] ...] :: action-if-true
-    test [params] [&& test [params] ...] !! action-if-false
+    test [params] [&& test [params] ...] :: action-if-true [reason]
+    test [params] [&& test [params] ...] !! action-if-false [reason]

Not all actions accept a reason argument. This only applies for allow/deny policies (i.e. those called through check_policy or assert_policy). It is not correct to say that users can add a reason arg to any action. You certainly cannot do this in the channel policy, for example.

rebased onto fa38c79

5 years ago

Removed reason string from general syntax (+rebase).

Commit e143da9 fixes this pull-request

Pull-Request has been merged by mikem

5 years ago