Skip to content

Instantly share code, notes, and snippets.

@resool
Last active June 28, 2018 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save resool/40468f20b862e360f1906f470dfb46eb to your computer and use it in GitHub Desktop.
Save resool/40468f20b862e360f1906f470dfb46eb to your computer and use it in GitHub Desktop.
Unfortunately there is no shortcut here, you have to revoke access for the whole table and then grant a SELECT privilege on each column except sensitive ones
-- revoke select access on encrypted_password and reset_password_token
BEGIN;
REVOKE SELECT ON admin_users FROM blazer;
GRANT SELECT (
email, reset_password_sent_at, remember_created_at, admin, deactivated_at, name, created_at, updated_at
) ON users TO blazer;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment