#21 Fixed access to admin's pages

Fixed access to admin's pages.
Added test.
ok, thanks, i'll rewrite it