-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
access.xml - Add support default value for permission #7517
Conversation
The calculated field is not updated until you save (read the notes). As your screenshot shows you haven't entered a title (which is required)
|
That's exactly what I wanted to show. If I set the default value to "Allowed" on a fresh new item, then IMO the calculated setting should reflect the actual state which is "Allowed" in that case. |
As the notes state the calculated setting is ONLY updated on save. Logical
|
I'm not yet sure what the purpose of the default is. |
I have rules in my new custom fields component which are not available in the global config. This rules should be by default "Allowed" for all groups. If an admin then wants to restrict permission for my custom rule then it can be done in the permissions. |
@brianteeman but then all the fields should be on Calculated setting initially on "Not allowed". IMO it should be the same for all, or not? |
In the case you have shown in the screenshot, all other actions are not allowed for registered users. Thus the calculated settings are actually correct. |
I mean I can live with it, that the "Calculated Setting" is calculated on Save and doesn't respect the initial default value. It is only cosmetic. |
Tested it successfully This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7517. |
This PR does the default value only as a visual thing by pre-selecting the respective option in the select. If you want to have the calculated value as well, then you would have to do a bit more code than that. Also when I look at the code, I think the default values are not used when calculating the actual value. So if you haven't saved the permissions yet, the default value isn't used at all. Which would be a major flaw in the PR. |
That is the only usecase I can see. But it has a lot of flaws to it imho and is countering how our ACL works:
I think there has to be a better approach to fix your issue with your fields. This one just feels wrong. |
Agree.
Think about a component which integrates the same way as com_categories (no own menu link in back end). If that component want's to add new rules, there is no way to set it globally. The admin has to go to every item and manually set it to allowed. What would be then the right way to add new rules in that way? |
This would be an abuse of view levels as access levels are intended to be used to display stuff and not while editing. |
Maybe consider adding an own menu item for that component which allows setting component wide permissions?
True |
For the time being, I made my own rules form field to add the default value for the new rule. I hope that this PR will be merged as there are use cases when a default value makes sense. |
That is probably the best approach for this quite usecase specific request. |
This request was not made for my specific use case. I've just tried to explain one use case. It was a coincident that @thongredweb made a PR which would solve my use case. |
Any news about this feature? |
Hello @thongredweb Thank you for your contribution. The last comment here was on 28th January 2016. So the question is, Is this issue/pull request still valid? Thanks for understanding! This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7517. |
Guess it didn't found much of acceptance. |
Closed as stated above. It can always be re-opened if needed This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7517. |
For now, when use ACL permission (by access.xml file for define rule), it's not support to set an default value for permission.
This PR for add an attribute "default" into an rule in access.xml file to set it default is "allow" or "denied", if default not specific, default rule will be "Inherit" as normal use.