11/* *
22 * Defines an access policy that allows a set of operations when the given condition is true.
33 *
4- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
4+ * @param operation: comma-separated list of "create", "read", "update", "post-update", " " delete". Use "all" to denote all operations.
55 * @param condition: a boolean expression that controls if the operation should be allowed.
66 */
77attribute @@allow(_ operation: String @@@completionHint(["'create'" , "'read'" , "'update'" , "'post-update'" ,"'delete'" , "'all'" ]), _ condition: Boolean )
@@ -10,24 +10,24 @@ attribute @@allow(_ operation: String @@@completionHint(["'create'", "'read'", "
1010 * Defines an access policy that allows the annotated field to be read or updated.
1111 * You can pass a third argument as `true` to make it override the model-level policies.
1212 *
13- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
13+ * @param operation: comma-separated list of "create", "read", "update", "post-update", " delete". Use "all" to denote all operations.
1414 * @param condition: a boolean expression that controls if the operation should be allowed.
1515 * @param override: a boolean value that controls if the field-level policy should override the model-level policy.
1616 */
17- // attribute @allow(_ operation: String @@@completionHint(["'create'", "'read'", "'update'", "'delete'", "'all'"]), _ condition: Boolean, _ override: Boolean?)
17+ // attribute @allow(_ operation: String @@@completionHint(["'create'", "'read'", "'update'", "'post-update'", "' delete'", "'all'"]), _ condition: Boolean, _ override: Boolean?)
1818
1919/* *
2020 * Defines an access policy that denies a set of operations when the given condition is true.
2121 *
22- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
22+ * @param operation: comma-separated list of "create", "read", "update", "post-update", " delete". Use "all" to denote all operations.
2323 * @param condition: a boolean expression that controls if the operation should be denied.
2424 */
2525attribute @@deny(_ operation: String @@@completionHint(["'create'" , "'read'" , "'update'" , "'post-update'" ,"'delete'" , "'all'" ]), _ condition: Boolean )
2626
2727/* *
2828 * Defines an access policy that denies the annotated field to be read or updated.
2929 *
30- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
30+ * @param operation: comma-separated list of "create", "read", "update", "post-update", " delete". Use "all" to denote all operations.
3131 * @param condition: a boolean expression that controls if the operation should be denied.
3232 */
3333// attribute @deny(_ operation: String @@@completionHint(["'create'", "'read'", "'update'", "'delete'", "'all'"]), _ condition: Boolean)
@@ -36,7 +36,7 @@ attribute @@deny(_ operation: String @@@completionHint(["'create'", "'read'", "'
3636 * Checks if the current user can perform the given operation on the given field.
3737 *
3838 * @param field: The field to check access for
39- * @param operation: The operation to check access for. Can be "read", "create", "update", or "delete". If the operation is not provided,
39+ * @param operation: The operation to check access for. Can be "read", "create", "update", "post-update", or "delete". If the operation is not provided,
4040 * it defaults the operation of the containing policy rule.
4141 */
4242function check(field: Any , operation: String ?): Boolean {
0 commit comments