Also is it good practice to use `<http://github.co...
# ory-selfhosting
p
Also is it good practice to use
<http://github.com/ory/client-go|github.com/ory/client-go>
and will this respect the relations i created in the namespace file?
Copy code
package main

import (
    "context"
    "fmt"
    ory "<http://github.com/ory/client-go|github.com/ory/client-go>"
    "os"
)

func main() {
    readServerUrl := "...."
    configuration := ory.NewConfiguration()
    configuration.Servers = []ory.ServerConfiguration{
       {
          URL: readServerUrl,
       },
    }
    readClient := ory.NewAPIClient(configuration)

    check, r, err := readClient.PermissionAPI.CheckPermission(context.Background()).
       Namespace("projects").
       Object("PROJECT_ID").
       Relation("edit").
       SubjectId("USER_ID").
       Execute()

    if err != nil {
       fmt.Fprintf(os.Stderr, "Full HTTP response (HasProjectEditPermission): %v\n", r)
       panic(err)
    }

    if !check.Allowed {
       fmt.Println("You do not have permission to edit this project")
       return
    }

    fmt.Println("You have permission to edit this project")
}