'Apply role manager'

def apply_method(self, r, **attr):

    method = self.method
    if (method == 'list'):
        output = self._list(r, **attr)
    elif (method in ('read', 'create', 'update')):
        output = self._edit(r, **attr)
    elif (method == 'delete'):
        output = self._delete(r, **attr)
    elif ((method == 'roles') and (r.name == 'user')):
        output = self._roles(r, **attr)
    elif (method == 'users'):
        output = self._users(r, **attr)
    else:
        r.error(405, current.ERROR.BAD_METHOD)
    if ((r.http == 'GET') and (method not in ('create', 'update', 'delete'))):
        current.session.s3.cancel = r.url()
    return output
