Modifying permissions function