savannah-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 8


From: Sylvain Beucler
Subject: [Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 89119385117ecf9db5b7240a519cce199a1d3b3e
Date: Sun, 14 Mar 2010 21:52:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Savane-cleanup framework".

The branch, master has been updated
       via  89119385117ecf9db5b7240a519cce199a1d3b3e (commit)
      from  1da7347388de196446fa5e7a1fece2abe9494ed1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=89119385117ecf9db5b7240a519cce199a1d3b3e

commit 89119385117ecf9db5b7240a519cce199a1d3b3e
Author: Sylvain Beucler <address@hidden>
Date:   Sun Mar 14 22:53:14 2010 +0100

    Trackers: permissions

diff --git a/savane/tracker/models.py b/savane/tracker/models.py
index 4df50ac..0e6b073 100644
--- a/savane/tracker/models.py
+++ b/savane/tracker/models.py
@@ -22,6 +22,47 @@ from django.db import models
 # fields) -> change to NULL?
 
 
+RESTRICTION_CHOICES = (('2', 'anonymous'),
+                       ('3', 'logged-in user'),
+                       ('5', 'project member'),)
+NEW_ITEM_POSTING_RESTRICTION_CHOICES = PERMISSION_CHOICES + (('', 'group type 
default'),)
+COMMENT_POSTING_RESTRICTION_CHOICES = PERMISSION_CHOICES + (('', 'same as new 
item'),)
+PERMISSION_CHOICES = (('', 'group type default'),
+                      ('9', 'none'),
+                      ('1', 'technician'),
+                      ('3', 'manager'),
+                      ('2', 'technician & manager'),)
+
+
+NOTIFICATION_ROLES = (
+    {'id': 1, 'label': 'SUBMITTER', 'short': 'Submitter', 'description': 'The 
person who submitted the item'},
+    {'id': 2, 'label': 'ASSIGNEE',  'short': 'Assignee' , 'description': 'The 
person to whom the item was assigned'},
+    {'id': 3, 'label': 'CC',        'short': 'CC'       , 'description': 'The 
person who is in the CC list'},
+    {'id': 4, 'label': 'SUBMITTER', 'short': 'Submitter', 'description': 'A 
person who once posted a follow-up comment'},
+)
+
+NOTIFICATION_EVENTS = (
+    {'id': 1, 'label': 'ROLE_CHANGE'     , 'short': 'Role has changed',
+     'description': "I'm added to or removed from this role"},
+    {'id': 2, 'label': 'NEW_COMMENT'     , 'short': 'New comment',
+     'description': 'A new followup comment is added'},
+    {'id': 3, 'label': 'NEW_FILE'        , 'short': 'New attachment',
+     'description': 'A new file attachment is added'},
+    {'id': 4, 'label': 'CC_CHANGE'       , 'short': 'CC Change',
+     'description': 'A new CC address is added/removed'},
+    {'id': 5, 'label': 'CLOSED'          , 'short': 'Item closed',
+     'description': 'The item is closed'},
+    {'id': 6, 'label': 'PSS_CHANGE'      , 'short': 'PSS change',
+     'description': 'Priority,Status,Severity changes'},
+    {'id': 7, 'label': 'ANY_OTHER_CHANGE', 'short': 'Any other Changes',
+     'description': 'Any changes not mentioned above'},
+    {'id': 8, 'label': 'I_MADE_IT'       , 'short': 'I did it',
+     'description': 'I am the author of the change'},
+    {'id': 9, 'label': 'NEW_ITEM'        , 'short': 'New Item',
+     'description': 'A new item has been submitted'},
+)
+
+
 class Tracker(models.Model):
     """
     Historically 4 trackers are hard-coded.
@@ -30,7 +71,6 @@ class Tracker(models.Model):
     Item.bugs_id / Item.patch_id / Item.support_id / Item.task_id
     (previous PHP implementation duplicated all tables).
     """
-
     NAME_CHOICES = (('bugs', 'bugs'),
                     ('patches', 'patches'),
                     ('support', 'support'),
@@ -38,6 +78,47 @@ class Tracker(models.Model):
                     )
     name = models.CharField(max_length=7, choices=NAME_CHOICES)
 
+class GroupTypeConfiguration(models.Model):
+    """
+    Previously in table "groups_type"
+    TODO: keep?
+    """
+    tracker = models.ForeignKey('Tracker')
+    group_type = models.IntegerField()  # TODO: ForeignKey
+    new_item_posting_restriction = models.CharField(max_length=1,
+                                                    
choices=NEW_ITEM_POSTING_RESTRICTION_CHOICES,
+                                                    blank=True)
+    comment_posting_restriction = models.CharField(max_length=1,
+                                                   
choices=COMMENT_POSTING_RESTRICTION_CHOICES,
+                                                   blank=True)
+    default_member_permission = models.CharField(max_length=1, 
choices=PERMISSION, blank=True)
+
+class GroupConfiguration(models.Model):
+    """
+    Previously in table "groups_default_permissions"
+    """
+    tracker = models.ForeignKey('Tracker')
+    group = models.ForeignKey('auth.Group')
+    new_item_restriction = models.CharField(max_length=1,
+                                            
choices=NEW_ITEM_POSTING_RESTRICTION_CHOICES,
+                                            blank=True)
+    comment_restriction = models.CharField(max_length=1,
+                                           
choices=COMMENT_POSTING_RESTRICTION_CHOICES,
+                                           blank=True)
+    default_member_permission = models.CharField(max_length=1, 
choices=PERMISSION, blank=True)
+
+class MemberPermission(models.Model):
+    """
+    Previously in table "user_group"
+    """
+    tracker = models.ForeignKey('Tracker')
+    group = models.ForeignKey('auth.Group')
+    user = models.ForeignKey('auth.Group')
+    permission = models.CharField(max_length=1, choices=Tracker.PERMISSION, 
blank=True)
+
+#class SquadPermission(models.Model): pass
+
+
 class Field(models.Model):
     """
     Fields definition for the 4 trackers (~70 fields each)
@@ -344,9 +425,8 @@ class ItemSpamScore(models.Model):
 
 
 # TODO:
-# - trackers_notification_event  # site-wide static kinds of notifications (9 
rows)
-# - trackers_notification_role   # site-wide static roles (4 rows)
-# - trackers_notification        # yes/no configuration depending on the above
+# - trackers_notification  # yes/no configuration depending on the events and 
roles
+# - groups  # per-group notification settings
 # - bugs_canned_responses
 # - user_votes
 

-----------------------------------------------------------------------

Summary of changes:
 savane/tracker/models.py |   88 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 84 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Savane-cleanup framework




reply via email to

[Prev in Thread] Current Thread [Next in Thread]