File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/canisters/frontend/ic-certified-assets/src Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ thread_local! {
32
32
static STATE : RefCell <State > = RefCell :: new( State :: default ( ) ) ;
33
33
}
34
34
35
+ pub fn with_state < F , R > ( f : F ) -> R
36
+ where
37
+ F : FnOnce ( & State ) -> R ,
38
+ {
39
+ STATE . with ( |s| f ( & s. borrow ( ) ) )
40
+ }
41
+
42
+
43
+
35
44
#[ query]
36
45
#[ candid_method( query) ]
37
46
fn api_version ( ) -> u16 {
@@ -387,11 +396,11 @@ fn can(permission: Permission) -> Result<(), String> {
387
396
} )
388
397
}
389
398
390
- fn can_commit ( ) -> Result < ( ) , String > {
399
+ pub fn can_commit ( ) -> Result < ( ) , String > {
391
400
can ( Permission :: Commit )
392
401
}
393
402
394
- fn can_prepare ( ) -> Result < ( ) , String > {
403
+ pub fn can_prepare ( ) -> Result < ( ) , String > {
395
404
can ( Permission :: Prepare )
396
405
}
397
406
You can’t perform that action at this time.
0 commit comments