Challenge Overview

Project Overview

The Planetary Data System (PDS http://pds.nasa.gov/) is an archive of data from NASA’s planetary missions. The mission data (called products) can be raw images, time-series data  or text documents.

While this treasure trove of information is accessible to the public, utilization has been somewhat limited by barriers to entry such as required expertise on the domain, and familiarity with the data format.

The goal of this (PDS Storyboard) project is to develop a web application that will make the data easier to find and use by a wider range of people. PDS data is only as valuable as the ease of access and adoption – and NASA wants to make sure all this valuable mission data reaches a broader audience to further scientific discovery and research.

We are building a basic web application version. We are starting by reusing an open source web application called myyna. The point is to create a Pinterest-like social web application that address the need to make PDS data more accessible, and foster greater use of the available resources through collaboration and ease of distribution of data and research. By making PDS data easily accessible, and providing a Pinterest-like collaboration tool, the goal is to advance research and utilization of the data. This new web application will be called the “Planetary Data Storyboard” (Or PDS).

We will customize Myyna web application to include the features we need to implement in the first version of this PDS Storyboard web application.

Challenge Overview

In this challenge we are adding new roles, privacy and permissions to the web application. In addition we are making some minor updates to the UX and UI pages.

Challenge Requirement

Category Update

We need to make the following changes to category concept in the app :

  • Allow logged in user to create a Category :

    • Right now Category can only be created via admin portal.

    • Any logged in user can create a Project.

    • Create a similar UI popup as the ‘create board’ UI popup.

  • Add “creator” field to the model to reference the user who created the category, it should be same logic as the one used in ‘board’ model.

  • Update the Category details page layout to match the board details page where we display Category image, Category name, Category description, owner name and photo, number of boards, number of members.

Roles based authorization

We are updating the application to allow adding users to category and board.

The concept is same as in gitlab/github, users have different abilities depending on the access level they have in a particular category or board. If a user is a member in a category then the highest permission level is used.

Currently we have a board creator (represents owner), and we have a follower (users follow board by clicking ‘follow’ button in board details page.

The new roles we will have are the following with what actions they can perform :

   

Note the following about role based action validation :

  • The above table list actions that might not be supported currently by the web application (i.e. leave comment), you will ignore these actions, we will launch challenges in future to add them to the web app.

  • We will have new role model definition in mongo db, with following values :

    • follower

    • contributor

    • admin

    • we don’t need to define role for regular user or guest user.

  • The role authorization information will be stored in route configuration (application/config/routes.js), we will add the following new fields :

    • role : represents the lowest role in role hierarchy allowed to performed the action.

    • public : flag indicates whether the route is public (by guest or not)

    • fn : this is existing field should support array value so we can add multiple functions as middlewares.

  • Routes sample :
    {route: '/addpin', controller: 'image_upload', public:false, role:’contributor’, action:'addpin',fn:['login_validate', ‘role_validate’]},
    {route: '/logout', controller: 'user', action: 'logout', public:true }

  • Update Routes configuration file with proper information following above table.

  • Add ‘role_validate’ middleware function to validate the user role :

    • Get the user from request

    • Get user from mongodb

    • Get role of the route, and get all parent roles recursively

    • Check if user has a role with access to the resource.

    • If not allowed then return ‘UnAuthorized Access’ error.

  • Roles will be assigned to users as follow :

    • When a user creates a category the user will be set as ‘creator’ (owner) of board/category.

    • When a user is added to a ‘category’ the user will have ‘admin’ role.

    • When a user is added to a ‘board’ the user will have the ‘contributor’ role.

    • When a user follow a board the user will become a follower.

    • User becomes ‘follower’ when click on ‘follow’ button in a board.

    • Non logged in users are ‘guest’s.

The new models needed to be added to support the Roles and Permissions can be as follow :

  • Role model, it’s a lookup collection, has the following fields :

    • _id

    • name

    • description

    • parent (role reference key)

  • UserRole mode, has the following fields :

    • User _id (reference key)

    • Role _id (reference key)

    • Type (enum: Board, Category)

    • Resource _id (depends on type, can be Board _id, or Category _id)

Manage Users

Add ‘manage users’ button to category details page and board details paged to allow managing users :

  • Clicking on button should display a popup same as when creating a board. The popup should have the following :

    • It should have an autocomplete field with ‘add’ button.

    • It should have a table with all existing users with their roles in that category/board.

    • There should be ‘remove’ button in table to remove the user.

    • The table should be scrollable.

    • Pagination should be progressive.

    • Add field to search existing users by username. It should do ajax call to filter table with result from backend.

  • For ‘manage users’ in category, all users added should get admin role.

  • For ‘manage users’ in board, all users added should get contributor role.

  • Your work should be responsive as the current website is responsive.

Gitlab Repository

We have cloned the myyna github and placed it in gitlab, user the gitlab repository as basis for your work.  https://gitlab.com/nasa-pds-storyboard/storyboard-frontend

You need to be logged in to view the repository. Note the following about current code base : 

  • It uses NodeJS V 8.x
  • It uses MongoDB  <= V 2.6.x
  • It can be deployed to Ubuntu or Mac OS X
  • It is not well documented so if you need any help to figure out how to get something to work, please post in challenge forums and Copilot will help you out.


Final Submission Guidelines

Deliverable

  • Patch file of changes.

  • Updated readme file with deployment.

  • Text file for reviewers.

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30050220