[AMBARI-24562] Protect the ClusterConfig resource so that only authorized users may have read-only access the data #2206
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Protect the ClientConfig resource so that only authorized users may have read-only access the data.
Users with the following permission should have read-only access:
CLUSTER.VIEW_CONFIGS
SERVICE.VIEW_CONFIGS
HOST.VIEW_CONFIGS
These permissions should be allow for the following roles:
AMBARI.ADMINISTRATOR
CLUSTER.ADMINISTRATOR
CLUSTER.OPERATOR
SERVICE.ADMINISTRATOR
SERVICE.OPERATOR
CLUSTER.USER
Users with no role related to the cluster may not view the data.
The
org.apache.ambari.server.security.TestAuthenticationFactory
was updated to match the permission sets from the database. This exposed issues in theorg.apache.ambari.server.controller.internal.AlertTargetResourceProviderTest
class, which needed to be fixed.This was cherry-picked from #2205
How was this patch tested?
Manually tested using users with various roles.
Updated unit tests, all passed.
Please review Ambari Contributing Guide before opening a pull request.