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 51 commits into
base: main
Choose a base branch
from
Open

Priv #13

wants to merge 51 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
-
vignettes/rls.Rmd Outdated Show resolved Hide resolved
@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.

vignettes/rls.Rmd Outdated Show resolved Hide resolved
tests/testthat/helper-rls.R Show resolved Hide resolved
#' 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?

Copy link
Member

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?

The getting started vignette has use of grant in it. Does that help?

My instinct was rls_column_privileges but it returns an empty

still looking at this...

Also who is jane in this context? Do I have to create jane as a user or something first?

A role user or role. I'll add more code to make it fully reproducible

Copy link
Member

Choose a reason for hiding this comment

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

@seankross

So one big thing to keep in mind is that the package is currently using behavior like that of httr2 where the sql is not executed until you use a separate function to run the SQL (req_perform). - OR - you can set auto_pipe(TRUE) to have policies and privileges code executed at the end of a pipe block

jane is a role in the examples. I've fixed examples for grant and revoke to create and cleanup the role jane or jill - let me know if these work or not

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