z_18_b_filetest.gno

0.57 Kb ยท 31 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	user = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj") // @test2
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
21	perms = boards2.NewBasicPermissions(commondao.New())
22}
23
24func main() {
25	testing.SetRealm(std.NewUserRealm(user))
26
27	boards2.SetPermissions(cross, bid, perms)
28}
29
30// Error:
31// unauthorized