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

feat(runtime/permissions): prompt fallback #9376

Merged
merged 31 commits into from
Apr 12, 2021
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0849cdc
feat: --prompt
crowlKats Mar 18, 2021
621fa81
Merge branch 'master' into permission_prompt_fallback
crowlKats Mar 18, 2021
a43fa1d
Merge branch 'master' into permission_prompt_fallback
crowlKats Mar 19, 2021
3078149
add test
crowlKats Mar 20, 2021
f3583b4
first part of denyalways hanndling
crowlKats Mar 20, 2021
2fe71fa
fix
crowlKats Mar 20, 2021
468af79
serde skip prompt
crowlKats Mar 20, 2021
42c607e
clean up
crowlKats Mar 20, 2021
a80e52c
Merge branch 'master' into permission_prompt_fallback
crowlKats Mar 21, 2021
4b94b67
Merge branch 'master' into permission_prompt_fallback
crowlKats Mar 30, 2021
8cef27e
remove 4-state prompting
crowlKats Mar 30, 2021
3f00d23
clean up
crowlKats Apr 4, 2021
33826df
Merge branch 'master' into permission_prompt_fallback
crowlKats Apr 8, 2021
0d59987
CI
crowlKats Apr 8, 2021
2dd190f
Merge branch 'master' into permission_prompt_fallback
crowlKats Apr 8, 2021
f64d83e
fix
crowlKats Apr 8, 2021
d27130d
CI
crowlKats Apr 8, 2021
ce0992c
Merge branch 'main' into permission_prompt_fallback
kt3k Apr 9, 2021
56a7ee6
Merge branch 'master' into permission_prompt_fallback
crowlKats Apr 9, 2021
41dba58
Merge branch 'main' into permission_prompt_fallback
bartlomieju Apr 9, 2021
c04c024
fix
crowlKats Apr 10, 2021
4fa49f5
fmt
crowlKats Apr 10, 2021
fa2b92f
fix
crowlKats Apr 10, 2021
c1d58b0
add test
crowlKats Apr 10, 2021
a22b50a
Merge branch 'master' into permission_prompt_fallback
crowlKats Apr 10, 2021
478e6f5
ci: touch diff files from main
kt3k Apr 10, 2021
a6bc675
ci: fix touch-diff script
kt3k Apr 11, 2021
7fd7415
handle denied_list
crowlKats Apr 11, 2021
63943d1
fix
crowlKats Apr 11, 2021
ee8d6da
CI
crowlKats Apr 11, 2021
0851bf7
Merge branch 'master' into permission_prompt_fallback
crowlKats Apr 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
crowlKats committed Apr 10, 2021
commit fa2b92f4daa1fa908b41facdcf82aef833aa3099
14 changes: 10 additions & 4 deletions runtime/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,22 @@ impl UnaryPermission<RunDescriptor> {
self.query(cmd)
}

pub fn check(&self, cmd: &str) -> Result<(), AnyError> {
pub fn check(&mut self, cmd: &str) -> Result<(), AnyError> {
self.query(Some(cmd)).check(
self.name,
Some(&format!("\"{}\"", cmd)),
self.prompt,
)
)?;
self.granted_list.insert(RunDescriptor(cmd.to_string()));
Ok(())
}

pub fn check_all(&self) -> Result<(), AnyError> {
self.query(None).check(self.name, Some("all"), self.prompt)
pub fn check_all(&mut self) -> Result<(), AnyError> {
self
.query(None)
.check(self.name, Some("all"), self.prompt)?;
self.global_state = PermissionState::Granted;
Ok(())
}
}

Expand Down