Grant all on a specific schema in the db to a group role in PostgreSQL

You found the shorthand to set privileges for all existing tables in the given schema. The manual clarifies: (but note that ALL TABLES is considered to include views and foreign tables). Bold emphasis mine. serial columns are implemented with nextval() on a sequence as column default and, quoting the manual: For sequences, this privilege allows … Read more

Best Practices for Roles vs. Claims in ASP.NET Identity

A role is a symbolic category that collects together users who share the same levels of security privileges. Role-based authorization requires first identifying the user, then ascertaining the roles to which the user is assigned, and finally comparing those roles to the roles that are authorized to access a resource. In contrast, a claim is … Read more

AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

This error is common if you try to deploy a Lambda in a VPC without giving it the required network interface related permissions ec2:DescribeNetworkInterfaces, ec2:CreateNetworkInterface, and ec2:DeleteNetworkInterface (see AWS Forum). For example, this a policy that allows to deploy a Lambda into a VPC: { “Version”: “2012-10-17”, “Statement”: [ { “Effect”: “Allow”, “Action”: [ “ec2:DescribeNetworkInterfaces”, … Read more

Group vs role (Any real difference?)

The divide between role and group comes from concepts of computer security (as opposed to simply resource management). Prof. Ravi Sandhu provides a seminal coverage of the semantic difference between roles and groups. http://profsandhu.com/workshop/role-group.pdf A group is a collection of users with a given set of permissions assigned to the group (and transitively, to the … Read more

Create PostgreSQL ROLE (user) if it doesn’t exist

Simple script (question asked) Building on @a_horse_with_no_name’s answer and improved with @Gregory’s comment: DO $do$ BEGIN IF EXISTS ( SELECT FROM pg_catalog.pg_roles WHERE rolname=”my_user”) THEN RAISE NOTICE ‘Role “my_user” already exists. Skipping.’; ELSE CREATE ROLE my_user LOGIN PASSWORD ‘my_password’; END IF; END $do$; Unlike, for instance, with CREATE TABLE there is no IF NOT EXISTS … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)