Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21602 Procedure v2 access control
  3. HBASE-21814

Remove the TODO in AccessControlLists#addUserPermission

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.2.0, 2.3.0
    • None
    • None

    Description

      The TODO was added by me. Because this method happens within the RS. The old impl use a login user(User.runAsLoginUser where the login user is the user who started RS process) to call Table.put(). And it will check the permission when put record to ACL table. At RpcServer we have a ThreadLocal where we keep the CallContext and inside that the current RPC called user info is set. We need Table.put(List<Put>) to change to a new thread and and so old ThreadLocal variable is not accessible and so it looks as if no Rpc context
      and we were relying on the super user who starts the RS process.

       

      User.runAsLoginUser(new PrivilegedExceptionAction<Void>() {
                @Override
                public Void run() throws Exception {
                  AccessControlLists.addUserPermission(regionEnv.getConfiguration(), perm,
                    regionEnv.getTable(AccessControlLists.ACL_TABLE_NAME), request.getMergeExistingPermissions());
                  return null;
                }
              });
      

       

      But after HBASE-21739, no need to User.runAsLoginUser. Because we will call Admin method to grant/revoke. And this will be execute in master and use the master user(the user who started master process) to call Table.put. So this is not a problem now.

      Attachments

        1. HBASE-21814.master.002.patch
          2 kB
          Guanghao Zhang
        2. HBASE-21814.master.002.patch
          2 kB
          Guanghao Zhang
        3. HBASE-21814.master.001.patch
          2 kB
          Guanghao Zhang
        4. HBASE-21814.master.001.patch
          2 kB
          Guanghao Zhang

        Issue Links

          Activity

            People

              zghao Guanghao Zhang
              zghao Guanghao Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: