func (u *User) HasAppWriteAccess(app string) bool {
	for _, a := range u.Applications {
		if a.Name != app {
			continue
		}
		for _, x := range a.Authorizations {
			if strings.ToLower(x) == "write" {
				return true
			}
		}
	}
	return false
}
HasAppWriteAccess returns true if user has write access to given app.
package plank
import (
	"fmt"
	"reflect"
	"strings"
	"sync"
)
type User struct {
	Name         string          `json:"name" yaml:"name" hcl:"name"`
	Admin        bool            `json:"admin" yaml:"admin" hcl:"admin"`
	Accounts     []Authorization `json:"accounts" yaml:"accounts" hcl:"accounts"`
	Applications []Authorization `json:"applications" yaml:"applications" hcl:"applications"`
}
type Authorization struct {
	Name string `json:"name" yaml:"name" hcl:"name"`
	Authorizations []string `json:"authorizations" yaml:"authorizations" hcl:"authorizations"`
}
func (u *User) IsAdmin() bool {
	return u.Admin == true
}