Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priv #13

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open

Priv #13

wants to merge 43 commits into from

Conversation

seankross
Copy link

Description

Related Issue

Example

Testing

sckott added 30 commits October 21, 2024 15:17
…ileges and row level policies in one fxn; add passwd table setup in a new man file
- add new as_priv s3 class
- rework how to make privileges
- add auto execute sql code with code from jqr
- import more rlang fxns
- example code for passwd table turned into a fxn to do one liner for table setup
- use one liner setup in privileges and row policy fxn docs
- rework rls_run to fetch con from query input if con not passed, also separate file
-
@seankross seankross marked this pull request as ready for review December 7, 2024 00:41
@seankross seankross marked this pull request as draft December 7, 2024 00:42
@sckott sckott marked this pull request as ready for review December 12, 2024 17:37
Copy link
Author

@seankross seankross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey I'm finally picking this back up. I have more of this to review but let's start with this.

#> 1 0 /root 111-222-3333 xxx Admin /bin/dash 0 admin
#> 2 1 /home/bob 123-456-7890 xxx Bob /bin/zsh 1 bob
#> 3 1 /home/alice 098-765-4321 xxx Alice /bin/zsh 2 alice
rls_run(policy1)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you remove or rename rls_run()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, now getting my head back into this it's rls_perform().

DBI::dbConnect(RPostgres::Postgres(), ...)
}, error = function(...) {
vars <- "try setting env vars: PGHOST, PGPORT, PGUSER, PGDATABASE"
testthat::skip(glue("Test database not available. {vars}"))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add PGPASSWORD to this list.

#' rls_tbl(con, "passwd") %>%
#' grant(update, select, cols = c("real_name", "home_phone")) %>%
#' to(jane)
#'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I see the results of grant in action? My instinct was rls_column_privileges but it returns an empty. Also who is jane in this context? Do I have to create jane as a user or something first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants