def add_role(role,**kwargs):
    """
        Add a new role
    """
    #check_perm(kwargs.get('user_id'), 'add_role')
    role_i = Role(name=role.name, code=role.code)
    db.DBSession.add(role_i)
    db.DBSession.flush()

    return role_i