Chapter 7. Migrating from Older Versions of RHMAP

7.1. Migrating from fh-nodeapp & fh-webapp/fh-api to fh-mbaas-api/fh-mbaas-express

fh-nodeapp & fh-webapp/fh-api are now deprecated in favour of fh-mbaas-api/fh-mbaas-express. fh-mbaas-api and fh-mbaas-express contain all the existing functionality found in fh-nodeapp and fh-webapp/fh-api, as well as new additional features, such as support for Data Browser and Forms.

The following outlines the migration steps to move from fh-nodeapp or fh-webapp/fh-api to fh-mbaas-api and fh-mbaas-express. Also, the Hello World Cloud Template is a good example of a minimal fh-mbaas-api/fh-mbaas-express Application, and is a good reference when migrating your App to fh-mbaas-api/fh-mbaas-express.

7.1.1. Change package.json

Update package.json:

  1. Remove fh-nodeapp or fh-webapp/fh-api and replace with the latest version of fh-mbaas-api as found in The Hello World Package.js file - for example,:

    "fh-mbaas-api" : "~4.5.0"
  2. You also need to explicitly include Express now also:

    "express": "~4.0.0",
    "body-parser": "~1.0.2",
    "cors": "~2.2.0"
  3. Finally, run npm install.

7.1.2. Change cloud code to replace $fh with fh

There is no longer a global $fh, you can create one if you want but it’s recommended to replace with fh instead:

  1. In lib/main.js, add var fh = require('fh-mbaas-api');.
  2. Replace usages of $fh with fh.
  3. Repeat for all files that use $fh.

7.1.3. Change application.js

Your application.js file is considerably different for fh-mbaas-api/fh-mbaas-express. It is recommended that you replace your existing application.js with the latest application.js file from the Hello World template app as this will always be the most up to date version

7.1.4. Use Grunt

This is optional but highly recommended: the newer FeedHenry Templates all make heavy use of Grunt, both for Local Development and to help with best practices for testing.

To use Grunt in your App, it’s best to copy the relevant Grunt parts of the Hello World Cloud Template:

  1. Copy the following Gruntfile into the root of your own App: https://github.com/feedhenry-templates/helloworld-cloud/blob/master/Gruntfile.js
  2. Copy the 'devDependencies' from this package.json into your own package.json: https://github.com/feedhenry-templates/helloworld-cloud/blob/master/package.json. Run npm install when you’re done.

7.2. Migrating From Roles to Teams

Teams is a powerful new system for controlling access to functional areas of the Platform.

This guide presents a comparison of Roles based restrictions and the new Permissions based restrictions. Each Role is compared to the Permissions needed to create an equivalent restriction.

7.2.1. Adding Permissions

In the Roles based permissions system, Roles are assigned to Users in three levels:

  • This Domain: The Role is active active for the domain represented by the current host name only.
  • All Domains: The Role is active for all domains owned by the Customer.
  • All Customers: The Role is active for all domains owned by all customers who are managed by the Current Reseller.

7.2.2. Analytics (analytics)

  • Can access the Analytics section of the Platform
  • Can monitor project usage.

The following Permissions assigned to a Team will allow equivalent access to Analytics:

  • Domain

    • Analytics (View)
    • Project (View)
    • Connection (No Access)
    • Cloud Resources (No Access)

7.2.3. Forms Editor (formseditor)

  • Can create forms and themes.
  • Can create Form Projects.
  • Can edit forms, themes, and Projects associated with their group(s).
  • Can associate forms and themes with projects in their group(s).

The following Permissions assigned to a Team will allow equivalent access to Forms:

  • Domain

    • Project (View & Edit)
    • Drag & Drop App (View & Edit)
  • Form

    • Submission (No Access)
Note

The concept of Groups has been removed from Drag & Drop Apps. It has been replaced by the Form Business Object.

7.2.4. Forms Administrator (formsadmin)

  • Can create forms and themes.
  • Can create Form Projects.
  • Can create groups.
  • Can assign users to groups.
  • Can view, access and manage all forms & themes created on a specific domain.
  • Can view submissions from all projects on the domain.
  • Can edit submissions from any project on the domain.

The following Permissions assigned to a Team will allow equivalent access to Forms

  • Domain

    • Project (View & Edit)
    • Drag & Drop App (View & Edit)
Note

The concept of Groups has been removed from Drag & Drop Apps. It has been replaced by the Form Business Object.

7.2.5. Submission Viewer (submissionsviewer)

  • Has access to view submissions from any project in their group(s).

The following Permissions assigned to a Team will allow equivalent access to Forms

  • Project (View)

    • Cloud Resources (No Access)
    • Connection (No Access)
    • Analytics (No Access)
    • Client App (No Access)
    • Cloud App (No Access)
  • Drag & Drop Apps (View)

    • Theme (No Access)

7.2.6. Submission Editor (submissionseditor)

  • Has access to view submissions from projects in their group(s)
  • Has access to edit submissions from projects in their group(s)

The following Permissions assigned to a Team will allow equivalent access to Forms

  • Project (View)

    • Cloud Resources (No Access)
    • Connection (No Access)
    • Analytics (No Access)
    • Client App (No Access)
    • Cloud App (No Access)
  • Drag & Drop Apps (View & Edit)

    • Form (View)
  • Submission (View & Edit)

    • Theme (No Access)

7.2.7. Developer Administrator (devadmin)

  • Can create and manage any type of Project.
  • Can build App binaries for all available platforms.
  • Can upload development resources such as private keys and certificates.
  • Can create, edit, and maintain deployment targets.
  • Can view and access all Projects & Apps on a specific domain.
  • Can view and edit all deployment targets on a specific domain.
  • Services (View)

    • Source Code (No Access)
    • Analytics (No Access)
    • Environment Variables (No Access)
    • Data Browser (No Access)
    • Cloud Deployment (No Access)
    • Stats (No Access)
    • Notifications (No Access)
    • Log (No Access)
    • Endpoints (No Access)
  • Project (View & Edit)
  • Drag & Drop Apps (View)

    • Form (View)
  • Submission (No Access)

7.2.8. Developer (dev)

  • Can create and manage any type of Project.
  • Can build App binaries for all available platforms.
  • Can upload development resources such as private keys and certificates.
  • Can create, edit, and maintain deployment targets.
  • Can add public services to a project.

The following Permissions assigned to a Team will allow equivalent access:

  • Services (View)

    • Source Code (No Access)
    • Analytics (No Access)
    • Environment Variables (No Access)
    • Data Browser (No Access)
    • Cloud Deployment (No Access)
    • Stats (No Access)
    • Notifications (No Access)
    • Log (No Access)
    • Endpoints (No Access)
  • Project (View & Edit)
  • Drag & Drop Apps (View)

    • Form (View)
  • Submission (No Access)

7.2.9. Service Administrator (serviceadmin)

  • Can provision mBaaS Services.
  • Can manage mBaaS Services.

The following Permissions assigned to a Team will allow equivalent access:

  • Domain

    • Services (View & Edit)

7.2.10. Domain Administrator (portaladmin)

  • Can create and edit Auth Policies.
  • Can update the App Store for their domain.
  • Can create and manage App Store Apps.
  • Can create and manage App Store Groups.
  • Can manage App Store Devices.
  • Can view App Store Logs.
  • Can access the 'Mobile App Management' section on the Admin page.
  • Can add and remove users.
  • Can assign roles to users.

The following Permissions assigned to a Team will allow equivalent access:

  • Domain

    • Authorization Policy (View & Edit)
    • App Store (View & Edit)
    • Admininstrator (View & Edit)

7.2.11. Customer Administrator (customeradmin)

  • Can manage users in any domain belonging to this customer.

The following Permissions assigned to a Team will allow equivalent access:

  • Customer

    • Administrator (View & Edit)

7.2.12. Reseller Administrator (reselleradmin)

  • Can manage users in any domain belonging to any of its customers.
  • Can assign the Customer Admin role to users.

The following Permissions assigned to a Team will allow equivalent access:

  • Reseller

    • Administrator (View & Edit)

7.2.13. Administrator (admin)

  • Can perform any action in the Platform.
  • Can assign Reseller Admin and Customer Admin roles to users.

The following Permissions assigned to a Team will allow equivalent access:

  • Reseller

    • Administrator (View & Edit)