Esempio n. 1
0
// CheckChanViewDataPerm returns the full permissions value for
// CheckChanViewData.
func CheckChanViewDataPerm(pkg string, u *core.User, ch *core.Channel, name string) (int, os.Error) {
	f := func(h interface{}) (int, os.Error) {
		f, ok := h.(func(string, *core.User, *core.Channel, string) (int, os.Error))
		if ok && f != nil {
			return f(pkg, u, ch, name)
		}
		return 0, nil
	}

	return runPermHooks(checkChanViewData[ch.Type()], f, false)
}