class Application(models.Model):
name = models.CharField(max_length=100)
icon_url = models.CharField(max_length=100)
app_url = models.CharField(max_length=200)
I would like to add another field for required_permission
which should be a foreign key to a permission. What should that field definition look like?
The reasoning behind this is that in a template, I can use something like this (psuedo code)
{% for app in application_list %}
{% if user_has_permission(app.required_permission) %}
Show App
{% endif %}
{% endfor %}