leg: add functional tests for the leg controller

Test the autorization logic between anon users and logged-in users.

Signed-off-by: diditclear <didyourupgradeclear@gmail.com>