peopledoc / django-chartjs

Django Class Based Views to generate Ajax charts js parameters.
Other
407 stars 112 forks source link

Chart display permission #59

Open AliPolat opened 2 years ago

AliPolat commented 2 years ago

Hi,

In order to display or not to display the chart for the current user, I overwrite the get_data method of BaseLineChartView class such as :

def get_data(self): """If not authorized, do not display chart""" if not self.request.user.is_superuser: return False

And this works and chart is not displayed as intended. But is there any other better practice for permission management?

Thank You