Coder Social home page Coder Social logo

com.dotcms.user-registration-app's Introduction

README

This is an example of how to create and load Jersey Based REST resource, that creates an user in dotCMS via OSGi

How to build this example

To install all you need to do is build the JAR. to do this run ./gradlew jar

This will build two jars in the build/libs directory: a bundle fragment (in order to expose needed 3rd party libraries from dotCMS) and the plugin jar

  • To install this bundle:

    Copy the bundle jar files inside the Felix OSGI container (dotCMS/felix/load).

    OR

    Upload the bundle jars files using the dotCMS UI (CMS Admin->Dynamic Plugins->Upload Plugin).

  • To uninstall this bundle:

    Remove the bundle jars files from the Felix OSGI container (dotCMS/felix/load).

    OR

    Undeploy the bundle jars using the dotCMS UI (CMS Admin->Dynamic Plugins->Undeploy).


How to use

Once installed, you can access this resource by:

POST /api/v1/users/

{
"firstName":"Test User",  
"lastName":"Test User",
"email":"[email protected]",
"password":[ "P","a","s","s","w","o","r","d","1","2","3","." ],
"roles": ["rolekey1","rolekey2",...],
"active": true|false
}

Required Properties:

  • firstName = string
  • lastName = string
  • email = string
  • password = char[]

Other properties:

  • Active = boolean, default false
  • Roles = list of rolekey
  • userId = string

Scenarios:

 1. No Auth or User doing the request do not have access to Users and Roles Portlets
 - Always will be inactive
 - Only the	Role DOTCMS_FRONT_END_USER will be added
 2. Auth, User is Admin or have access to Users and Roles Portlets
 - Can be active if JSON includes ("active": true)
 - The list of RoleKey will be use to assign the roles, if the roleKey doesn't exist will be
 created under the ROOT ROLE.

Authentication

This API allows anon users to call it, but users created that way will be inactive and will only have DOTCMS_FRONT_END_USER role added.

com.dotcms.user-registration-app's People

Contributors

erickgonzalez avatar jdotcms avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.