z_18_a_filetest.gno
0.68 Kb ยท 33 lines
1package main
2
3import (
4 "testing"
5
6 "gno.land/p/nt/commondao"
7
8 boards2 "gno.land/r/gnoland/boards2/v1"
9)
10
11const (
12 owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13 bid = boards2.BoardID(0) // Operate on realm instead of individual boards
14)
15
16var perms boards2.Permissions
17
18func init() {
19 // Create a new permissions instance without users
20 perms = boards2.NewBasicPermissions(commondao.New())
21}
22
23func main() {
24 testing.SetRealm(testing.NewUserRealm(owner))
25
26 boards2.SetPermissions(cross, bid, perms)
27
28 // Owner that setted new permissions is not a member of the new permissions
29 println(boards2.IsMember(bid, owner))
30}
31
32// Output:
33// false