Implemented login tokens. Set user permissions.