1

Based on Django REST framework: Check user is in group , I have succesfully restricted my custom views to certain groups.

Yet, I need to restrict dj_rest_auth.views.RegisterView to a certain group.

How can I make it?

I thought of trying to set a wrapper class over RegisterView, and link my wrapper class in urls.py, but what methods should I override?

Thank you SO much!

glezo
  • 742
  • 2
  • 9
  • 22

1 Answers1

0

Well, it seems dj-rest-auth is ready for this need:

#settings.py
REST_AUTH_REGISTER_PERMISSION_CLASSES = ("rest_framework.permissions.IsAuthenticated","api.permissions.HasLoginPermission")

Keep in mind there's a bug in dj-rest-auth<1.1.12 that prevents those string to work.

glezo
  • 742
  • 2
  • 9
  • 22