-
-
Notifications
You must be signed in to change notification settings - Fork 436
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 to copy ACL and config path #2774
Conversation
I like it, but do we need this in production mode? Change
to
What do think? |
Do we have to adjust openmage-theme (SCSS, CSS) too? |
I didn't test with openmage theme. For production mode, normal admin can use only |
I know that extension, but cant find it (was it a hackathon project?) There is a similar one: https://github.com/ericthehacker/magento-configscopehints (and https://github.com/avstudnitz/AvS_ScopeHint). |
good idea. |
good idea.
|
I think that I have added all comments to the PR (except the red icon). It's not necessary to update openmage theme. |
Think v19 is correct. Will test it later. |
Yes? No? To know if I try to add the red mark or not. |
So I installed this PR: But I don't see effects: Any idea what I miss. [edit] OOOPs, only for developer mode. |
<copy_path translate="label"> | ||
<label>Allow to copy/paste roles and configuration path</label> | ||
<frontend_type>select</frontend_type> | ||
<source_model>adminhtml/system_config_source_yesno</source_model> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of yes/no:
- Only in Developer Mode (default)
- Yes
- No
why is this feature behind "developer mode"? I don't see why normal admin shouldn't be able to copy ACLs from a role to another no? |
When you are a normal admin user, you can use only allowed config path in email, cms and pages, so this PR display copy links only for allowed config paths. But it's true that if you are a normal admin user with access to all admin features, you can add any config paths to allowed list. This PR display all copy links only in dev mode because I supposed that there are useless when you are using the backend as a normal user, not as a dev user. |
I think #3960 will be merged before this one and this one will have to be slightly adjusted, for example using the copy icon and the js functions ;-) |
@@ -77,6 +77,10 @@ protected function _getNodeJson($node, $level = 0) | |||
$item['sort_order'] = isset($node->sort_order) ? (string)$node->sort_order : 0; | |||
$item['id'] = (string)$node->attributes()->aclpath; | |||
|
|||
if (Mage::getIsDeveloperMode() && Mage::getStoreConfigFlag('admin/design/copy_path')) { | |||
$item['text'] .= '</a> <a href="javascript:copyText(\'' . $item['id'] . '\');" class="copycnf">(' . $item['id'] . ')'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name conflict, see PR #3960
@@ -11,6 +11,11 @@ | |||
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org) | |||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |||
*/ | |||
|
|||
function copyText(txt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name conflict, see PR #3960
I agree with @fballiano, this PR needs to incorporate what was done in PR #3960. |
Yes, but I can't do it for now. |
Description
A new feature!
Bellow click on the link, and paste the config path where you want!
You can disable it from System > Configuration > Admin > Admin theme (admin/design/copy_path).
Tested with Firefox 108, Chrome 108, Opera 94.
navigator.clipboard.writeText
require Firefox 63+, Chrome 66+, Edge 79+, Opera 53+, Safari 13.1+ (mdn docs).1/ Go to System / Configuration:
before/after
2/ Go to System / Web Services / SOAP Roles, add or edit any role:
before/after
3/ Go to System / Permissions / Roles, add or edit any role:
before/after
Warning
Not complete for System / Web Services / REST Roles, I'm not sure how them works.
Contribution checklist