First pass at adding permissions, also update it so keys are attributed to the currently logged in user instead of a hardcoded user id of 1