Add "cdb_org_admin" and "cdb_org_user" roles as part of extension
This commit is contained in:
parent
2f1fdf5a15
commit
5e28417b3d
5
Makefile
5
Makefile
@ -16,6 +16,9 @@ PGXS := $(shell $(PG_CONFIG) --pgxs)
|
||||
include $(PGXS)
|
||||
|
||||
$(EXTENSION)--$(EXTVERSION).sql: $(CDBSCRIPTS) cartodb_hooks.sql Makefile
|
||||
cat $(CDBSCRIPTS) | sed 's/\<public\./cartodb./g' > $@
|
||||
echo "SET search_path TO cartodb,public,pg_catalog;" > $@
|
||||
cat $(CDBSCRIPTS) | \
|
||||
sed -e 's/\<public\./cartodb./g' \
|
||||
-e 's/:DATABASE_USERNAME/cdb_org_admin/g' >> $@
|
||||
echo "GRANT USAGE ON SCHEMA cartodb TO public;" >> $@
|
||||
cat cartodb_hooks.sql >> $@
|
||||
|
13
scripts-available/CDB_Roles.sql
Normal file
13
scripts-available/CDB_Roles.sql
Normal file
@ -0,0 +1,13 @@
|
||||
DO LANGUAGE 'plpgsql' $$
|
||||
BEGIN
|
||||
IF NOT EXISTS ( SELECT * FROM pg_roles WHERE rolname= 'cdb_org_admin' )
|
||||
THEN
|
||||
CREATE ROLE cdb_org_admin NOLOGIN;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS ( SELECT * FROM pg_roles WHERE rolname= 'cdb_org_user' )
|
||||
THEN
|
||||
CREATE ROLE cdb_org_user NOLOGIN;
|
||||
END IF;
|
||||
END
|
||||
$$;
|
1
scripts-enabled/000-CDB_Roles.sql
Symbolic link
1
scripts-enabled/000-CDB_Roles.sql
Symbolic link
@ -0,0 +1 @@
|
||||
../scripts-available/CDB_Roles.sql
|
Loading…
Reference in New Issue
Block a user