~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: William Grant
  • Date: 2010-02-17 08:37:22 UTC
  • Revision ID: grantw@unimelb.edu.au-20100217083722-ji4v6fbztngy0p3s
Add UI to edit/delete enrolments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
472
472
        return "<%s %r in %r>" % (type(self).__name__, self.user,
473
473
                                  self.offering)
474
474
 
 
475
    def get_permissions(self, user, config):
 
476
        # A user can edit any enrolment that they could have created.
 
477
        perms = set()
 
478
        if ('enrol_' + str(self.role)) in self.offering.get_permissions(
 
479
            user, config):
 
480
            perms.add('edit')
 
481
        return perms
 
482
 
 
483
    def delete(self):
 
484
        """Delete this enrolment."""
 
485
        Store.of(self).remove(self)
 
486
 
 
487
 
475
488
# PROJECTS #
476
489
 
477
490
class ProjectSet(Storm):