SDK
SDK Java v2.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Constructors #

Instantiates a new Role object, which defines a set of right policies.


Role(Security, id, content, [meta]) #

ArgumentsTypeDescription
SecuritySecurityAn instantiated Security object
idstringUnique role identifier
contentJSON ObjectRole content
metaJSON ObjectRole metadata

Note: this constructor won't make any call to Kuzzle.


Properties #

Property nameTypeDescriptionget/set
contentJSON objectRaw role contentget
idstringUnique profile identifierget
metaJSON objectRole metadataget

Return Value #

Returns the Role object.

Usage #

JSONObject roleDefinition = new JSONObject()
  .put("controllers", new JSONObject()
    .put("*", new JSONObject()
      .put("actions", new JSONObject()
        .put("*", true)
      )
    )
  )
);
Role role = new Role(kuzzle.security, "role ID", roleDefinition);