Initial code for backend CAS and roles management support.
Merge branch 'issue7' into test