#NEWLINE# @ require_enabled #NEWLINE# def save_site_privilege( self , site_priv ) : #NEWLINE# #INDENT# if ( site_priv . user . kuser_id and site_priv . site . tenant_id ) : #NEWLINE# #INDENT# self . driver . add_user_role ( site_priv . user . kuser_id , site_priv . site . tenant_id , site_priv . role . role_type ) #NEWLINE# #UNINDENT# site_priv . enacted = datetime . now ( ) #NEWLINE# site_priv . save ( update_fields = [ 'enacted' ] )