Updated permission generation
Removed unused variable