z_18_a_filetest.gno

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