Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-library/pull/33#discussion_r62207834
--- Diff:
software/database/src/main/java/org/apache/brooklyn/entity/database/postgresql/PostgreSqlNode.java
---
@@ -90,6 +95,29 @@
String.class, "postgresql.username", "Username of the database
user");
String DEFAULT_USERNAME = "postgresqluser";
+
+ @SetFromFlag("roles")
+ ConfigKey<Map<String, Object>> ROLES = new MapConfigKey(Map.class,
"postgresql.roles", "Initial roles with permissions",
+ ImmutableMap.<String, Object>of(
+ "Admin", ImmutableMap.of(
+ "properties", "SUPERUSER",
+ "privilages", "ALL PRIVILEGES ON ALL TABLES IN
SCHEMA public"
+ ),
+ "Data_Modeler", ImmutableMap.of(
+ "properties", "CREATEDB CREATEROLE",
+ "privilages", "ALL PRIVILEGES ON ALL TABLES IN
SCHEMA public"
+ ),
+ "Developer", ImmutableMap.of(
+ "privilages", ImmutableList.of("SELECT,
INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public",
+ "EXECUTE ON ALL FUNCTIONS IN SCHEMA
public")
+ ),
+ "Analyst", ImmutableMap.of(
+ "privilages", "SELECT ON ALL TABLES IN SCHEMA
public"
+ )
+ ));
+
+ @SetFromFlag("createRoles")
+ ConfigKey<Boolean> CREATE_ROLES =
ConfigKeys.newBooleanConfigKey("create.roles", "Should roles be created with
database initialization", false);
--- End diff --
Do you really need this? Why not just check if config key ROLES is not
empty?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---