Permission handling

Added three state permission handling
Fixed bug in GroupHandler