Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn committed Aug 29, 2024
1 parent 5603761 commit 21cf5c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/gno.land/p/demo/access/example_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package access

func ExamplePackageLevel() {
// set this globally or during init()
acl := New()
set := New()

// in functions
acl.AssertCurrentHasAccess()
set.AssertCallerHasAccess()
}

func ExampleEmbedding() {
Expand All @@ -22,5 +22,5 @@ func ExampleEmbedding() {
}

// check from the context of the object.
myObject.Set.AssertCurrentHasAccess()
myObject.Set.AssertCallerHasAccess()
}
4 changes: 2 additions & 2 deletions examples/gno.land/p/demo/access/set.gno
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ func (s *Set) ForceDel(addr std.Address) error {

// Assert functions

// AssertCurrentHasAccess checks whgnether the PrevRealm is whitelisted as authorized
// AssertCallerHasAccess checks whether the caller is whitelisted as authorized
// If not, it panics indicating restricted access
func (s *Set) AssertCurrentHasAccess() {
func (s *Set) AssertCallerHasAccess() {
if err := s.CallerIsAuthorized(); err != nil {
panic(ErrUnauthorized)
}
Expand Down

0 comments on commit 21cf5c9

Please sign in to comment.