implementing clientSide authorization