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

« back to all changes in this revision

Viewing changes to ivle/database.py

  • Committer: matt.giuca
  • Date: 2009-01-14 07:41:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:branches%2Fstorm:1130
ivle.database.User: Add the missing methods from ivle.user.User.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
    def __repr__(self):
91
91
        return "<%s '%s'>" % (type(self).__name__, self.login)
 
92
 
 
93
    def has_cap(self, capability):
 
94
        """Given a capability (which is a Role object), returns True if this
 
95
        User has that capability, False otherwise.
 
96
        """
 
97
        return self.role.hasCap(capability)
 
98
 
 
99
    # XXX Should be @property
 
100
    def pass_expired(self):
 
101
        """Determines whether the pass_exp field indicates that
 
102
           login should be denied.
 
103
        """
 
104
        fieldval = self.pass_exp
 
105
        return fieldval is not None and time.localtime() > fieldval
 
106
    # XXX Should be @property
 
107
    def acct_expired(self):
 
108
        """Determines whether the acct_exp field indicates that
 
109
           login should be denied.
 
110
        """
 
111
        fieldval = self.acct_exp
 
112
        return fieldval is not None and time.localtime() > fieldval