From 36f55bf7a2cdbfc255457b9989c007e3c1dc8bd1 Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Wed, 3 Jul 2024 16:35:53 +0300 Subject: [PATCH 1/3] can create policy --- docs/3.0/associations/belongs_to.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/3.0/associations/belongs_to.md b/docs/3.0/associations/belongs_to.md index cab12ffd..04896085 100644 --- a/docs/3.0/associations/belongs_to.md +++ b/docs/3.0/associations/belongs_to.md @@ -64,6 +64,7 @@ Any string. :::option `can_create` + Controls the creation link visibility on forms. #### Default @@ -73,6 +74,10 @@ Controls the creation link visibility on forms. #### Possible values `true`, `false` +:::warning Since version , the target resource policy takes precedence over this option. +`field :user, as: :belongs_to, can_create: true` + +In this example, even if the `can_create` option is set to `true`, if the `UserPolicy` responds with `false` to the `create?` method, the creation link will **NOT** be visible. ::: ## Overview From 98ebe74ddc029cd82b70effc97af37dd4631b07a Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Wed, 3 Jul 2024 16:37:45 +0300 Subject: [PATCH 2/3] Revert "can create policy" This reverts commit 36f55bf7a2cdbfc255457b9989c007e3c1dc8bd1. --- docs/3.0/associations/belongs_to.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/3.0/associations/belongs_to.md b/docs/3.0/associations/belongs_to.md index 04896085..cab12ffd 100644 --- a/docs/3.0/associations/belongs_to.md +++ b/docs/3.0/associations/belongs_to.md @@ -64,7 +64,6 @@ Any string. :::option `can_create` - Controls the creation link visibility on forms. #### Default @@ -74,10 +73,6 @@ Controls the creation link visibility on forms. #### Possible values `true`, `false` -:::warning Since version , the target resource policy takes precedence over this option. -`field :user, as: :belongs_to, can_create: true` - -In this example, even if the `can_create` option is set to `true`, if the `UserPolicy` responds with `false` to the `create?` method, the creation link will **NOT** be visible. ::: ## Overview From 6ae793b7c692a5bc41a4dab8c41aaa3766f99763 Mon Sep 17 00:00:00 2001 From: Paul Bob <69730720+Paul-Bob@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:44:19 +0300 Subject: [PATCH 3/3] can_create_policy (#232) --- docs/3.0/associations/belongs_to.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/3.0/associations/belongs_to.md b/docs/3.0/associations/belongs_to.md index cab12ffd..da57f3a5 100644 --- a/docs/3.0/associations/belongs_to.md +++ b/docs/3.0/associations/belongs_to.md @@ -73,6 +73,10 @@ Controls the creation link visibility on forms. #### Possible values `true`, `false` +:::warning Since version , the target resource policy takes precedence over this option. +`field :user, as: :belongs_to, can_create: true` + +In this example, even if the `can_create` option is set to `true`, if the `UserPolicy` responds with `false` to the `create?` method, the creation link will **NOT** be visible. ::: ## Overview