I am working on a task to retrieve a set of permissions assigned to a group in Django and I can get the created groups using the below code, but could not use it to get the permissions assigned to them:

```
from django.contrib.auth.models import Group, Permission
groups = Group.objects.all()

```

I am not really sure how to get permissions assigned to these groups.

`permissions = Permission.objects.all()` gives me all the permissions, but I could not figure out how to get permissions assigned to a particular group.

Any pointers would be appreciated.