diff --git a/.gitignore b/.gitignore index 74d6b881..fb0f181e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /dist/ /django_scheduler.egg-info/ /docs/_build/ +.idea/ diff --git a/schedule/migrations/0004_auto_20161228_0745.py b/schedule/migrations/0004_auto_20161228_0745.py new file mode 100644 index 00000000..8a5a02a3 --- /dev/null +++ b/schedule/migrations/0004_auto_20161228_0745.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.1 on 2016-09-21 07:45 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('schedule', '0003_auto_20160715_0028'), + ] + + operations = [ + migrations.AlterModelOptions( + name='calendar', + options={'permissions': (('view_calendar', 'View Calendar'),), 'verbose_name': 'calendar', 'verbose_name_plural': 'calendar'}, + ), + migrations.AlterModelOptions( + name='calendarrelation', + options={'permissions': (('view_calendar_relation', 'View Calendar Relation'),), 'verbose_name': 'calendar relation', 'verbose_name_plural': 'calendar relations'}, + ), + migrations.AlterModelOptions( + name='event', + options={'permissions': (('view_event', 'View Event'),), 'verbose_name': 'event', 'verbose_name_plural': 'events'}, + ), + migrations.AlterModelOptions( + name='eventrelation', + options={'permissions': (('view_event_relation', 'View Event Relation'),), 'verbose_name': 'event relation', 'verbose_name_plural': 'event relations'}, + ), + migrations.AlterModelOptions( + name='occurrence', + options={'permissions': (('view_occurrence', 'View Occurrence'),), 'verbose_name': 'occurrence', 'verbose_name_plural': 'occurrences'}, + ), + migrations.AlterModelOptions( + name='rule', + options={'permissions': (('view_occurrence', 'View Occurrence'),), 'verbose_name': 'rule', 'verbose_name_plural': 'rules'}, + ), + ] diff --git a/schedule/models/calendars.py b/schedule/models/calendars.py index 3e59a864..6bd4323e 100644 --- a/schedule/models/calendars.py +++ b/schedule/models/calendars.py @@ -149,6 +149,9 @@ class Meta(object): verbose_name = _('calendar') verbose_name_plural = _('calendar') app_label = 'schedule' + permissions = ( + ('view_calendar', _('View Calendar')), + ) def __str__(self): return self.name @@ -240,6 +243,9 @@ class Meta(object): verbose_name = _('calendar relation') verbose_name_plural = _('calendar relations') app_label = 'schedule' + permissions = ( + ('view_calendar_relation', _('View Calendar Relation')), + ) def __str__(self): return '%s - %s' % (self.calendar, self.content_object) diff --git a/schedule/models/events.py b/schedule/models/events.py index 0cc8ba59..a70b2d19 100644 --- a/schedule/models/events.py +++ b/schedule/models/events.py @@ -88,6 +88,9 @@ class Meta(object): verbose_name = _('event') verbose_name_plural = _('events') app_label = 'schedule' + permissions = ( + ('view_event', _('View Event')), + ) index_together = ( ('start', 'end'), ) @@ -538,6 +541,9 @@ class Meta(object): verbose_name = _("event relation") verbose_name_plural = _("event relations") app_label = 'schedule' + permissions = ( + ('view_event_relation', _('View Event Relation')), + ) def __str__(self): return '%s(%s)-%s' % (self.event.title, self.distinction, self.content_object) @@ -560,6 +566,9 @@ class Meta(object): verbose_name = _("occurrence") verbose_name_plural = _("occurrences") app_label = 'schedule' + permissions = ( + ('view_occurrence', _('View Occurrence')), + ) index_together = ( ('start', 'end'), ) diff --git a/schedule/models/rules.py b/schedule/models/rules.py index 3e6f2a22..2ce90504 100644 --- a/schedule/models/rules.py +++ b/schedule/models/rules.py @@ -58,6 +58,9 @@ class Meta(object): verbose_name = _('rule') verbose_name_plural = _('rules') app_label = 'schedule' + permissions = ( + ('view_occurrence', _('View Occurrence')), + ) def rrule_frequency(self): compatibiliy_dict = {