adding index and unique on perm name
refacotring to make __callStatic handle creates too