Add authorization to user

    user : string
        username
    auth : string
        authorization name

    CLI Example:

    .. code-block:: bash

        salt '*' rbac.auth_add martine solaris.zone.manage
        salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail.mailq

def auth_add(user, auth):
    '''
    Add authorization to user

    user : string
        username
    auth : string
        authorization name

    CLI Example:

    .. code-block:: bash

        salt '*' rbac.auth_add martine solaris.zone.manage
        salt '*' rbac.auth_add martine solaris.zone.manage,solaris.mail.mailq
    '''
    ret = {}

    ## validate auths
    auths = auth.split(',')
    known_auths = auth_list().keys()
    valid_auths = [r for r in auths if r in known_auths]
    log.debug(
        'rbac.auth_add - auths=%s, known_auths=%s, valid_auths=%s',
        auths,
        known_auths,
        valid_auths,
    )

    ## update user auths
    if valid_auths:
        res = __salt__['cmd.run_all']('usermod -A "{auths}" {login}'.format(
            login=user,
            auths=','.join(set(auth_get(user, False) + valid_auths)),
        ))
        if res['retcode'] > 0:
            ret['Error'] = {
                'retcode': res['retcode'],
                'message': res['stderr'] if 'stderr' in res else res['stdout']
            }
            return ret

    ## update return value
    active_auths = auth_get(user, False)
    for a in auths:
        if a not in valid_auths:
            ret[a] = 'Unknown'
        elif a in active_auths:
            ret[a] = 'Added'
        else:
            ret[a] = 'Failed'

    return ret