Make all dashboards public [2021:HPR]

Issue #1018 resolved
Ghislain Hachey created an issue

Ideally no login is required to view all the dashboards. Something like an anonymous user.

Comments (10)

  1. Brian Lewis repo owner

    Quite a lot of issues to address in this…. how to indicate an ‘anonymous’ user?, where does their menu come from? how to restrict what they can see and do?

    Steps to make this work:

    1. turn on ‘Public Access’

    create the key ‘allowPublicAccess’ value = “1” in web.config AppSettings

        <add key="allowPublicAccess" value="1"/>
    

    2. Create Menu options for public states.

    ui-router states have been added for Public access. These include dashboards, and indicator states. To access these they need to be defined in Navigation in IdentitiesP.

    Use this script:

    begin transaction

    Select * from Navigation

    DELETE from Navigation
    WHERE id like 'public%'

    INSERT INTO Navigation
    (id
    , icon
    , label
    , state
    , children
    , note
    )
    Select 'public.' + id
    , icon
    , label
    , replace(state,'site.indicators','public.indicators')
    , replace(children,'indicators.','public.indicators.')
    , note
    FROM Navigation
    WHERE id like 'indicators%'

    INSERT INTO Navigation
    (id, icon, label, state)
    VALUES ('public.dashboards.schools','pie-chart', 'Schools','public.dashboards.schools')
    , ('public.dashboards.teachers','pie-chart', 'Teachers','public.dashboards.teachers')
    , ('public.dashboards.exams','pie-chart', 'Exams','public.dashboards.exams')

    INSERT INTO Navigation
    (id, icon, label, children)
    VALUES ('public.dashboards','pie-chart', 'Dashboards','public.dashboards.schools|public.dashboards.teachers|public.dashboards.exams')
    , ('PUBLIC','pie-chart', 'Public Access','public.indicators.miemis|public.dashboards')

    Select * from Navigation
    rollback

    and set the public.indicators.miemis node to the set of indicators you want ( and commit!)

  2. Brian Lewis repo owner

    Step 2a: Configure the PUBLIC Navigation node.

    This navigation menu named PUBLIC is loaded for any Public Access. I should only contain children that point to the public states (public.dashboards. public.indicators.) otherwise they will fail as not authorized and throw you back to the signin page.

  3. Brian Lewis repo owner

    At this point it will be good to go:

    when allowPublicAccess as per 1) in web.config, you get a public access button on signin:

  4. Brian Lewis repo owner

    Follow Public Access and you go to Public Access home page, with PUBLIC menu in the navigation bar:

  5. Brian Lewis repo owner

    Security Notes:

    No authentication token is ever issued by the server in Public Access mode. So, only REST endpoints that allow unauthenticated access can be accessed.

    The permissions settings by Topic and Level (eg. School.ReadX, Exams.Admin etc) are all 0 ie there are no permissions available.

    If the anonymous user tries to navigate to a protected page (e.g. /schools.list) then they will be returned to the signin page.

  6. Log in to comment