Added permissions.
Changed permissions function to dynamic args