Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple caplitalized words (like typical vendor names) in ACL resource IDs #1397

Merged
merged 3 commits into from
Jul 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"Element 'resource': [facet 'minLength'] The value has a length of '4'; this underruns the allowed " .
"minimum length of '8'.",
"Element 'resource': [facet 'pattern'] The value 'One:' is not accepted by the " .
"pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource': 'One:' is not " . "a valid value of the atomic type 'typeAclResourceId'."
],
],
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Config/etc/system.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
</xs:annotation>

<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
<xs:pattern value="([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
<xs:minLength value="8" />
</xs:restriction>
</xs:simpleType>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Config/etc/system_file.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
</xs:annotation>

<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
<xs:pattern value="([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
<xs:minLength value="8" />
</xs:restriction>
</xs:simpleType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'</resources></acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value 'test_Value::show_toolbar' is " .
"not accepted by the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"not accepted by the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': 'test_Value::show_toolbar' is not a valid value of the atomic type " .
"'typeId'.",
"Element 'resource', attribute 'id': Warning: No precomputed value available, " .
Expand All @@ -62,7 +62,7 @@
'</resources></acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_value::show_toolbar' is not " .
"accepted by the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"accepted by the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': 'Test_value::show_toolbar' is not a valid value of the atomic type " .
"'typeId'.",
"Element 'resource', attribute 'id': Warning: No precomputed value available, " .
Expand All @@ -75,7 +75,7 @@
'</resources></acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value 'M@#$%^*_Value::show_toolbar' is not " .
"accepted by the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"accepted by the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': 'M@#$%^*_Value::show_toolbar' " .
"is not a valid value of the atomic type " .
"'typeId'.",
Expand All @@ -89,7 +89,7 @@
'</resources></acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value '_Value::show_toolbar' is not " .
"accepted by the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"accepted by the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': '_Value::show_toolbar' " .
"is not a valid value of the atomic type 'typeId'.",
"Element 'resource', attribute 'id': " .
Expand All @@ -102,7 +102,7 @@
'</acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value 'Value_::show_toolbar' is not " .
"accepted by the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"accepted by the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': 'Value_::show_toolbar' " .
"is not a valid value of the atomic type 'typeId'.",
"Element 'resource', attribute 'id': " .
Expand All @@ -115,7 +115,7 @@
'</resources></acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_value:show_toolbar' is not " .
"accepted by the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"accepted by the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': 'Test_value:show_toolbar' is not a valid value of the atomic " .
"type 'typeId'.",
"Element 'resource', attribute 'id': " .
Expand All @@ -127,7 +127,7 @@
'<?xml version="1.0"?><config><acl><resources><resource id="Test_Value::"/></resources>' . '</acl></config>',
[
"Element 'resource', attribute 'id': [facet 'pattern'] The value 'Test_Value::' is not accepted by " .
"the pattern '[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"the pattern '([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}'.",
"Element 'resource', attribute 'id': 'Test_Value::' is not a valid value of the atomic type 'typeId'.",
"Element 'resource', attribute 'id': " .
"Warning: No precomputed value available, the value was either invalid " .
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/Magento/Framework/Acl/etc/acl.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</xs:annotation>

<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]+[a-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
<xs:pattern value="([A-Z]+[a-z0-9]{1,}){1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
</xs:restriction>
</xs:simpleType>

Expand Down