diff options
Diffstat (limited to 'app/domain/user.go')
| -rw-r--r-- | app/domain/user.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/domain/user.go b/app/domain/user.go index 52cd780..88930c5 100644 --- a/app/domain/user.go +++ b/app/domain/user.go @@ -1,6 +1,9 @@ package domain -import "github.com/xlgmokha/x/pkg/x" +import ( + v1 "github.com/authzed/authzed-go/proto/authzed/api/v1" + "github.com/xlgmokha/x/pkg/x" +) type User struct { ID ID `json:"id" jsonapi:"primary,users"` @@ -37,3 +40,11 @@ func (self *User) Sparkle(sparklee string, reason string) *Sparkle { func (self *User) ToGID() string { return "gid://sparkle/User/" + self.ID.String() } + +func (self *User) ToObjectReference() *v1.ObjectReference { + // TODO:: Username is easy for demos but will need to change to ID + return &v1.ObjectReference{ + ObjectType: "user", + ObjectId: self.Username, + } +} |
