creating own authrization mechanism