Cleaned up code, implemented permission viewing

Signed-off-by: interdpth <interdpth@gmail.com>