'Checks if a given user has access to a given subject.'

def CheckPermissions(self, username, subject):

    if (subject in self.authorized_users):
        return ((username in self.authorized_users[subject]) or self.group_access_manager.MemberOfAuthorizedGroup(username, subject))
    raise InvalidSubject(('Subject    %s    was    not    found.' % subject))
