Added client-side de authorization checks.
Added server-side authorization checks for user permissions.
Added tests for authorize.js.