-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Improve Setting class and other core classes that inherit from it #8173
Comments
That's on purpose. You can change this by changing We could make
|
Maybe you can also provide an example I do not yet really understand the problem. In the actual plugin settings only those settings are shown that a user has write permission, so there should be no problem. All the settings by |
@tsteur The problem is that Particular example is this url If I modify It is either issue with |
That's on purpose currently to keep things simple until we specifically develop API's to make it possible
If someone sets
When kinda user type do you introduce there? Piwik is not really built for this so we might have to change a lot. Maybe easiest way would be to just hide the Apart from this it seems like a problem that a super user can have write permission without read permission. Although by definition a super user has in Piwik read permission to more or less anything. |
@tsteur Problem lays here https://github.com/PiwikPRO/plugin-CloudAdmin/issues/63 We have superUser and magicAdmin. magicAdmin stands above superUser with permissions at least in the case of Cloud. This magicAdmin is admin user for whole cloud. AFAFIK we cannot influence superUser in matter of We cannot hide I think that Setting classes even System Settings should be modifiable at least under some conditions. |
I thought about it for a while and think we could change If not I think in this case an event (when getting all settings that are writable by current user eg here https://github.com/piwik/piwik/blob/2.14.0-b10/core/Plugin/Settings.php#L137 or https://github.com/piwik/piwik/blob/2.14.0-b10/core/Settings/Manager.php#L101) should be more appropriate than allowing users to change |
@tsteur This doesn't slove anything, because To explain what I mean it in simple words. I think that superUser is too hardcoded in Piwik and we cannot modify who is superUser for real. We have a need to modify some of superUser privileges. From my point of view, there should be only normal users and all access should be defined by configuration. Like in ACL design pattern. |
That's what I'm saying is the bug. Once we make the change there should no exception anymore and it should be not displayed in the UI.
That would be a different issue see eg #1568 |
That would be nice but it will solve only part of the problem. Because one thing is that setting shouldn't be writeable by the user other than magicAdmin. It should be readable by the Tracker and I'm not sure on which user Tracker works. So I'm not sure if operating only on Maybe there should be some third parameter like |
Tracker wouldn't be a problem as it will be readable there. I reckon re the other concern an event to "filter" writable settings might be best solution and maybe there should be a better solution re the magicAdmin some time so that it is part of the platform and not a custom solution. |
Possibility to filter available setting would solve the issue if it will disable settings for user. Even if the user will cook up request it should be thrown away. |
@tsteur That's a new idea, and maybe best solution for mid/long term... @sebastianpiskorski is this issue a blocker for you, or just a suggestion? |
@mattab This is a suggestion and also a nice step in direction of access control granularity I think. At least in the area of Piwik Settings. So far I've manage to overcome this limitation. |
This topic didn't come up again in the last few years, so I'll close it for now. Not even sure if the same problem still exists, as there has been a lot happened to the code since 2015. If it comes up again, we can create a new one. |
Goal of this ticket is to improve Piwik\Plugin\Settings class and/or Piwik\Settings\Setting and other core classes that inherits after latter one.
Classes should provide better control of who have access to data that they manage. Because this data takes part in rendering of specific views which are beyond possibilities of control by plugins.
Simplest way would be to provide a way to change SystemSetting::$writableByCurrentUser to false. If state of $writableByCurrentUser is such, then it is not rendered on Plugin settings page.
Be careful! If state of SystemSetting::$readableByCurrentUser is set to false, then page throws error.
The text was updated successfully, but these errors were encountered: