Adding permission table and management. Maintains backwards comptibility.
updating test cases
updating test cases
Finalized permissions. Finished test cases.