algairim commented on a change in pull request #1275:
URL: https://github.com/apache/brooklyn-server/pull/1275#discussion_r752401940



##########
File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
##########
@@ -494,16 +493,16 @@ public HighAvailabilitySummary 
getHighAvailabilityPlaneStates() {
 
     @Override
     public Response clearHighAvailabilityPlaneStates() {
-        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.SYSTEM_ADMIN, null))
-            throw WebResourceUtils.forbidden("User '%s' is not authorized to 
perform this operation", Entitlements.getEntitlementContext().user());
+        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.HA_ADMIN, null))

Review comment:
       Require `Entitlements.HA_ADMIN` to clear HA.

##########
File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java
##########
@@ -494,16 +493,16 @@ public HighAvailabilitySummary 
getHighAvailabilityPlaneStates() {
 
     @Override
     public Response clearHighAvailabilityPlaneStates() {
-        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.SYSTEM_ADMIN, null))
-            throw WebResourceUtils.forbidden("User '%s' is not authorized to 
perform this operation", Entitlements.getEntitlementContext().user());
+        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.HA_ADMIN, null))
+            throw 
WebResourceUtils.forbidden(USER_OPERATION_NOT_AUTHORIZED_MSG, 
Entitlements.getEntitlementContext().user());
         mgmt().getHighAvailabilityManager().publishClearNonMaster();
         return Response.ok().build();
     }
 
     @Override
     public Response clearHighAvailabilityPlaneStates(String nodeId) {
-        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.SYSTEM_ADMIN, null))
-            throw WebResourceUtils.forbidden("User '%s' is not authorized to 
perform this operation", Entitlements.getEntitlementContext().user());
+        if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), 
Entitlements.HA_ADMIN, null))

Review comment:
       Require `Entitlements.HA_ADMIN` to clear HA.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to