diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java index 574fa0e7166..4ae8e0fa7ef 100644 --- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java +++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java @@ -502,6 +502,7 @@ public class RSGroupAdminEndpoint extends RSGroupAdminService if (master.getMasterCoprocessorHost() != null) { master.getMasterCoprocessorHost().preRenameRSGroup(oldRSGroup, newRSGroup); } + checkPermission("renameRSGroup"); groupAdminServer.renameRSGroup(oldRSGroup, newRSGroup); if (master.getMasterCoprocessorHost() != null) { master.getMasterCoprocessorHost().postRenameRSGroup(oldRSGroup, newRSGroup); diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java index 8a8f011727d..3d19df008d3 100644 --- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java +++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsBase.java @@ -292,8 +292,8 @@ public abstract class TestRSGroupsBase { boolean postRemoveServersCalled = false; boolean preMoveServersAndTables = false; boolean postMoveServersAndTables = false; - boolean preReNameRSGroupCalled = false; - boolean postReNameRSGroupCalled = false; + boolean preRenameRSGroupCalled = false; + boolean postRenameRSGroupCalled = false; public void resetFlags() { preBalanceRSGroupCalled = false; @@ -310,8 +310,8 @@ public abstract class TestRSGroupsBase { postRemoveServersCalled = false; preMoveServersAndTables = false; postMoveServersAndTables = false; - preReNameRSGroupCalled = false; - postReNameRSGroupCalled = false; + preRenameRSGroupCalled = false; + postRenameRSGroupCalled = false; } @Override @@ -403,13 +403,13 @@ public abstract class TestRSGroupsBase { @Override public void preRenameRSGroup(ObserverContext ctx, String oldName, String newName) throws IOException { - preReNameRSGroupCalled = true; + preRenameRSGroupCalled = true; } @Override public void postRenameRSGroup(ObserverContext ctx, String oldName, String newName) throws IOException { - postReNameRSGroupCalled = true; + postRenameRSGroupCalled = true; } } -} \ No newline at end of file +} diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java index 3122e590c09..f1cb4d8a3d0 100644 --- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java +++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsWithACL.java @@ -356,4 +356,19 @@ public class TestRSGroupsWithACL extends SecureTestUtil{ verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); } + + @Test + public void testRenameRSGroup() throws Exception { + AccessTestAction action = new AccessTestAction() { + @Override + public Object run() throws Exception { + rsGroupAdminEndpoint.checkPermission("renameRSGroup"); + return null; + } + }; + + verifyAllowed(action, SUPERUSER, USER_ADMIN, USER_GROUP_ADMIN); + verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, + USER_NONE, USER_GROUP_READ, USER_GROUP_WRITE, USER_GROUP_CREATE); + } }