@@ -174,29 +174,6 @@ function hasSome(field: Any[], search: Any[]): Boolean {
174174function isEmpty(field: Any []): Boolean {
175175} @@@expressionContext([AccessPolicy, ValidationRule])
176176
177- /* *
178- * The name of the model for which the policy rule is defined. If the rule is
179- * inherited to a sub model, this function returns the name of the sub model.
180- *
181- * @param optional parameter to control the casing of the returned value. Valid
182- * values are "original", "upper", "lower", "capitalize", "uncapitalize". Defaults
183- * to "original".
184- */
185- function currentModel(casing: String ?): String {
186- } @@@expressionContext([AccessPolicy])
187-
188- /* *
189- * The operation for which the policy rule is defined for. Note that a rule with
190- * "all" operation is expanded to "create", "read", "update", and "delete" rules,
191- * and the function returns corresponding value for each expanded version.
192- *
193- * @param optional parameter to control the casing of the returned value. Valid
194- * values are "original", "upper", "lower", "capitalize", "uncapitalize". Defaults
195- * to "original".
196- */
197- function currentOperation(casing: String ?): String {
198- } @@@expressionContext([AccessPolicy])
199-
200177/* *
201178 * Marks an attribute to be only applicable to certain field types.
202179 */
@@ -658,56 +635,3 @@ attribute @meta(_ name: String, _ value: Any)
658635 * Marks an attribute as deprecated.
659636 */
660637attribute @@@deprecated(_ message: String )
661-
662- /* --- Policy Plugin --- */
663-
664- /* *
665- * Defines an access policy that allows a set of operations when the given condition is true.
666- *
667- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
668- * @param condition: a boolean expression that controls if the operation should be allowed.
669- */
670- attribute @@allow(_ operation: String @@@completionHint(["'create'" , "'read'" , "'update'" , "'post-update'" ,"'delete'" , "'all'" ]), _ condition: Boolean )
671-
672- /* *
673- * Defines an access policy that allows the annotated field to be read or updated.
674- * You can pass a third argument as `true` to make it override the model-level policies.
675- *
676- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
677- * @param condition: a boolean expression that controls if the operation should be allowed.
678- * @param override: a boolean value that controls if the field-level policy should override the model-level policy.
679- */
680- // attribute @allow(_ operation: String @@@completionHint(["'create'", "'read'", "'update'", "'delete'", "'all'"]), _ condition: Boolean, _ override: Boolean?)
681-
682- /* *
683- * Defines an access policy that denies a set of operations when the given condition is true.
684- *
685- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
686- * @param condition: a boolean expression that controls if the operation should be denied.
687- */
688- attribute @@deny(_ operation: String @@@completionHint(["'create'" , "'read'" , "'update'" , "'post-update'" ,"'delete'" , "'all'" ]), _ condition: Boolean )
689-
690- /* *
691- * Defines an access policy that denies the annotated field to be read or updated.
692- *
693- * @param operation: comma-separated list of "create", "read", "update", "delete". Use "all" to denote all operations.
694- * @param condition: a boolean expression that controls if the operation should be denied.
695- */
696- // attribute @deny(_ operation: String @@@completionHint(["'create'", "'read'", "'update'", "'delete'", "'all'"]), _ condition: Boolean)
697-
698- /* *
699- * Checks if the current user can perform the given operation on the given field.
700- *
701- * @param field: The field to check access for
702- * @param operation: The operation to check access for. Can be "read", "create", "update", or "delete". If the operation is not provided,
703- * it defaults the operation of the containing policy rule.
704- */
705- function check(field: Any , operation: String ?): Boolean {
706- } @@@expressionContext([AccessPolicy])
707-
708- /* *
709- * Gets entity's value before an update. Only valid when used in a "post-update" policy rule.
710- */
711- function before(): Any {
712- } @@@expressionContext([AccessPolicy])
713-
0 commit comments