To manage permission we create Groups in SharePoint. In Custom SharePoint application or webpart, we have to check user permissions or may have activate different functionality.
For that We need to check Current User Group..
Here is a function that will return true/false by providing Group Name!
You may provide web object for performance tuning.