#NEWLINE# @ hooks . register ( 'register_permissions' ) #NEWLINE# def register_permissions( ) : #NEWLINE# #INDENT# user_permissions = Q ( content_type__app_label = AUTH_USER_APP_LABEL , codename__in = [ ( 'add_%s' % AUTH_USER_MODEL_NAME . lower ( ) ) , ( 'change_%s' % AUTH_USER_MODEL_NAME . lower ( ) ) , ( 'delete_%s' % AUTH_USER_MODEL_NAME . lower ( ) ) ] ) #NEWLINE# group_permissions = Q ( content_type__app_label = 'auth' , codename__in = [ 'add_group' , 'change_group' , 'delete_group' ] ) #NEWLINE# return Permission . objects . filter ( ( group_permissions | group_permissions ) )