Add group support.  

Add's groups support to the geonode_authorize_layer.sql function.  The logic is backwards compatible with deployments that have disabled group support.