def perm(self): system = MediaDropPermissionSystem(self.pylons_config) system.policies = [self.policy] user = DBSession.query(User).filter(User.user_name == u'admin').one() return UserPermissions(user, system)