Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_18_a_filetest.gno

0.66 Kb ยท 33 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/gnoland/boards"
 7
 8	boards2 "gno.land/r/boards000/v1rc1"
 9)
10
11const (
12	owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13	bid           = boards.ID(0)                               // Operate on realm instead of individual boards
14)
15
16var perms boards.Permissions
17
18func init() {
19	// Create a new permissions instance without users
20	perms = boards2.NewBasicPermissions()
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