modify the assign permission function