Added system permission awareness in DAL
minor clean up