added administrator role

This commit is contained in:
Rocky Duan
2012-08-14 15:58:04 -07:00
parent 529c323771
commit eef24a5ebe
5 changed files with 53 additions and 27 deletions

View File

@@ -11,7 +11,8 @@ class Role(models.Model):
def __unicode__(self):
return self.name + " for " + (self.course_id if self.course_id else "all courses")
def inherit_permissions(self, role):
def inherit_permissions(self, role): # TODO the name of this method is a little bit confusing,
# since it's one-off and doesn't handle inheritance later
if role.course_id and role.course_id != self.course_id:
logging.warning("%s cannot inheret permissions from %s due to course_id inconsistency" %
(self, role))