Skip to content

Commit

Permalink
chore: remove GetDAO from Permissions interface
Browse files Browse the repository at this point in the history
THis was discussed at some point but it turns out is not going to be
used by Boards2.
  • Loading branch information
jeronimoalbi committed Feb 20, 2025
1 parent 72c1407 commit 17377ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
10 changes: 1 addition & 9 deletions examples/gno.land/r/nt/boards2/v1/permissions.gno
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package boards2

import (
"std"

"gno.land/p/nt/commondao"
)
import "std"

const (
PermissionBoardCreate Permission = "board:create"
Expand Down Expand Up @@ -64,9 +60,5 @@ type (

// HasUser checks if a user exists.
HasUser(std.Address) bool

// GetDAO returns the underlying DAO.
// Returned value can be nil if the implementation doesn't have a DAO.
GetDAO() *commondao.CommonDAO // TODO: should return an interface
}
)
6 changes: 0 additions & 6 deletions examples/gno.land/r/nt/boards2/v1/permissions_default.gno
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ func (dp DefaultPermissions) HasUser(user std.Address) bool {
return dp.users.Has(user.String())
}

// GetDAO returns the underlying DAO.
// Returned value can be nil if the implementation doesn't have a DAO.
func (dp DefaultPermissions) GetDAO() *commondao.CommonDAO {
return dp.dao
}

// WithPermission calls a callback when a user has a specific permission.
// It panics on error or when a handler panics.
// Callbacks are by default called when there is no handle registered for the permission.
Expand Down

0 comments on commit 17377ea

Please sign in to comment.