protected void addAuthorizationToRole(String roleName, String resourceType, RoleAuthorizationEntity roleAuthorization) {
    if ((roleAuthorization != null) && !StringUtils.isEmpty(roleName) && !StringUtils.isEmpty(resourceType)) {
      PermissionDAO permissionDAO = injector.getInstance(PermissionDAO.class);
      ResourceTypeDAO resourceTypeDAO = injector.getInstance(ResourceTypeDAO.class);

      PermissionEntity role = permissionDAO.findPermissionByNameAndType(roleName, resourceTypeDAO.findByName(resourceType));
      if (role != null) {
        role.addAuthorization(roleAuthorization);
        permissionDAO.merge(role);
      }
    }
  }
Add a new authorization to the set of authorizations for a role

@param roleName          the name of the role
@param resourceType      the resource type of the role (AMBARI, CLUSTER, VIEW, etc...)
@param roleAuthorization the authorization to add
ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java