/** * Method to add new log entry for the resource update. * @param userRegistry user registry to add logs * @param resourcePath updated resource path * @param action log action * @param actionData additional details about the action * @throws RegistryException */ private static void addLogEntryForResourceUpdate(UserRegistry userRegistry, String resourcePath, int action, String actionData) throws RegistryException { try { CurrentSession.setTenantId(userRegistry.getTenantId()); CurrentSession.setUser(userRegistry.getUserName()); if (userRegistry.getRegistryContext() != null) { userRegistry.getRegistryContext().getLogWriter().addLog(resourcePath, userRegistry.getUserName(), action, actionData); } else { Resource resource = userRegistry.get(resourcePath); userRegistry.put(resourcePath, resource); } if (log.isDebugEnabled()) { log.debug("update role authorizations of the resource: " + resourcePath); } } finally { CurrentSession.removeTenantId(); CurrentSession.removeUser(); } } }
/** * Method to add new log entry for the resource update. * @param userRegistry user registry to add logs * @param resourcePath updated resource path * @param action log action * @param actionData additional details about the action * @throws RegistryException */ private static void addLogEntryForResourceUpdate(UserRegistry userRegistry, String resourcePath, int action, String actionData) throws RegistryException { try { CurrentSession.setTenantId(userRegistry.getTenantId()); CurrentSession.setUser(userRegistry.getUserName()); if (userRegistry.getRegistryContext() != null) { userRegistry.getRegistryContext().getLogWriter().addLog(resourcePath, userRegistry.getUserName(), action, actionData); } else { Resource resource = userRegistry.get(resourcePath); userRegistry.put(resourcePath, resource); } if (log.isDebugEnabled()) { log.debug("add new role authorization of the resource: " + resourcePath); } } finally { CurrentSession.removeTenantId(); CurrentSession.removeUser(); } } }