def get_perms_for_model(cls):
 if isinstance(cls, basestring):
  (app_label, model_name) = cls.split(u'.')
  model = apps.get_model(app_label, model_name)
 else:
  model = cls
 ctype = get_content_type(model)
 return Permission.objects.filter(content_type=ctype)

def get_perms_for_model ( cls ) : if isinstance ( cls , basestring ) : ( app_label , model_name ) = cls . split ( u'.' ) model = apps . get_model ( app_label , model_name ) else : model = cls ctype = get_content_type ( model ) return Permission . objects . filter ( content_type = ctype )
returns queryset of all permission objects for the given class .