Replies: 6 comments
-
Good idea, I'll have a look into it |
Beta Was this translation helpful? Give feedback.
-
Currently we use explicit those properties to ensure that PageExtensions don't change our intent. Editable can be changed by extensions, but the properties InsertAllowed and so on cannot be changed. Additionally I think it's necessary to set InsertAllowed to false on API Pages, that you don't have to set DelayedInsert to true. |
Beta Was this translation helpful? Give feedback.
-
Thank you for that insight @pri-kise, I didn't realize that you could change the I personally didn't encounter any use cases where the page has We could make the rule, in case the page 50100 MyPage
{
// Raise a rule to adapt to Editable = false;
InsertAllowed = false;
ModifyAllowed = false;
DeleteAllowed = false;
Extensible = false;
} page 50100 MyPage
{
// Do not raise a rule (this prohibits an page extension to change these properties)
InsertAllowed = false;
ModifyAllowed = false;
DeleteAllowed = false;
Extensible = true; // The default is true, so not explicit declaring this property here is the same
} page 50100 MyPage
{
// Do not raise a rule (page can not be extended)
Editable = false;
Extensible = false;
} page 50100 MyPage
{
// Raise a rule to adapt to Insert/Modified/Delete to prevent an page extension to change these properties
Editable = false;
Extensible = true;
} In combination with LC0034 - The property Extensible should be explicitly set for public objects. this rule could make sense. But to be honest I'm doubting a bit here, because of the default true value of the The rule would even do the opposite I think; Modifying from Editable to Allow (to prevent a possible page extension to change the behavior). |
Beta Was this translation helpful? Give feedback.
-
I have ran into something that was very similar: In my scenario the page had I think that this example could still be a separate rule which could raise a diagnostic that informs the developer that setting |
Beta Was this translation helpful? Give feedback.
-
Having the 3 properties (InsertAllowed, DeleteAllowed, ModifyAllowed) set to false is NOT the same like Editable = false. |
Beta Was this translation helpful? Give feedback.
-
One more thing to consider, even if you set
I see that we also have |
Beta Was this translation helpful? Give feedback.
-
Would this perhaps be a rule that you're willing to consider for LinterCop?
If a page has InsertAllowed = false, ModifyAllowed = false and DeleteAllowed = false, that combination of properties is functionally equivalent to Editable = false, but the latter more clearly expresses the developer's intent.
Beta Was this translation helpful? Give feedback.
All reactions