'GET /api/roles/{encoded_role_id}
Displays information about a role.'

@web.expose_api
def show(self, trans, id, **kwd):

    role_id = id
    try:
        decoded_role_id = trans.security.decode_id(role_id)
    except TypeError:
        trans.response.status = 400
        return ('Malformed    role    id    (    %s    )    specified,    unable    to    decode.' % str(role_id))
    try:
        role = trans.sa_session.query(trans.app.model.Role).get(decoded_role_id)
    except:
        role = None
    if ((not role) or (not (trans.user_is_admin() or trans.app.security_agent.ok_to_display(trans.user, role)))):
        trans.response.status = 400
        return ('Invalid    role    id    (    %s    )    specified.' % str(role_id))
    item = role.to_dict(view='element', value_mapper={'id': trans.security.encode_id})
    item['url'] = url_for('role', id=role_id)
    return item
