Added a get privilege function
Could not get ajax to work, because the script part is not compiling when the document is loaded.

Try to fix this, so that the set alias function is called in ajax rather than as a link.
Appropriate redirecting on the basis of the alias that needs to be set