You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/12/26 05:37:02 UTC

[GitHub] [hbase] virajjasani commented on a change in pull request #2809: HBASE-25432:add security checks for setTableStateInMeta and fixMeta

virajjasani commented on a change in pull request #2809:
URL: https://github.com/apache/hbase/pull/2809#discussion_r548946432



##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
##########
@@ -379,6 +381,36 @@ public void testUnauthorizedStopMaster() throws Exception {
         USER_GROUP_WRITE, USER_GROUP_CREATE);
   }
 
+  @Test
+  public void testUnauthorizedSetTableStateInMeta() throws Exception {
+    AccessTestAction action = new AccessTestAction() {
+      @Override public Object run() throws Exception {

Review comment:
       Let's use lambda here?
   ```
       AccessTestAction action = () -> {
   ...
   ...
   ...
         return null;
       };
   ```

##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
##########
@@ -379,6 +381,36 @@ public void testUnauthorizedStopMaster() throws Exception {
         USER_GROUP_WRITE, USER_GROUP_CREATE);
   }
 
+  @Test
+  public void testUnauthorizedSetTableStateInMeta() throws Exception {
+    AccessTestAction action = new AccessTestAction() {
+      @Override public Object run() throws Exception {
+        Connection conn = ConnectionFactory.createConnection(TEST_UTIL.getConfiguration()) ;
+        Hbck hbck = conn.getHbck();
+        hbck.setTableStateInMeta(new TableState(TEST_TABLE, TableState.State.DISABLED));
+        return null;
+      }
+    };
+
+    verifyDenied(action, USER_CREATE, USER_OWNER, USER_RW, USER_RO, USER_NONE, USER_GROUP_READ,
+        USER_GROUP_WRITE, USER_GROUP_CREATE);
+  }
+
+  @Test
+  public void testUnauthorizedFixMeta() throws Exception {
+    AccessTestAction action = new AccessTestAction() {
+      @Override public Object run() throws Exception {

Review comment:
       Same here




----------------------------------------------------------------
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.

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