Added authorization logic

Signed-off-by: Eric Lobdell <eric@ericlobdell.io>