cancel
Showing results for 
Search instead for 
Did you mean: 

How to Export Role Details?

Former Member
0 Kudos

Is there a way to export the Role settings? I am trying to document the settings on Each Role and was hoping there was a way to extract it. I've notice when I export the schema I see some info on the Roles, however it only shows the fields that are read-only for the Role.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Actually Kanstantsin, that is not true the Role detials that I see in the schema do not include any field you have write access to, It only shows the ready only fields.

I am aware that I can use API etc to help with updates, but is there an API to extract the Role details (not the Roles to user assignments)

Former Member
0 Kudos

Hello Brad,

I tried below code and it's giving fields having read-write access... hope this will help...

	RepositorySessionContext rsc = new RepositorySessionContext(server, repo, usr);
	try {
	    SessionManager.getInstance().createSession(rsc, SessionTypes.REPOSITORY_SESSION_TYPE, pw);
	    RepositorySchemaEx rse = MetadataManager.getInstance().getRepositorySchema(rsc);
	    RoleProperties rp = rse.getRole("Master Data Expert");

	    RepositoryAccessPermissions rap = rp.getRepositoryAccessPermissions();
	    TableId tableId = rse.getTableId("MDM_MATERIALS");
	    FieldProperties[] fps = rse.getFields(tableId);
	    for (FieldProperties fp : fps) {
		int permission = rap.getFieldPermission(fp.getTableId(), fp.getId());
		try {
		    Field[] fields = AccessPermission.class.getFields();
		    for (Field field : fields) {
			if (field.getName().contains("ACCESS") && ("" + field.get(null)).equals("" + permission)) {
			    System.out.println(fp.getName().get() + ": " + field.getName());
			}
		    }
		} catch (Exception e) {
		    e.printStackTrace();
		}
	    }
	} catch (Exception e) {
	    e.printStackTrace();
	} finally {
	    SessionManager.getInstance().destroySessions(rsc);
	}

Former Member
0 Kudos

Hi Brad,

the schema export only gives you role information that has been changed from the standard setting. When I do documentation for MDM (I created an XSL for this), then I refer to the customized elements and simply write for the rest that they behave according to the MDM standard.

This may not help you if you really need an extract but gives you an idea on documentation.

Best regards

Christian

Former Member
0 Kudos

Hello Brand

All roles and it's permissions have saved in repository schema.

In additional you can use JAVA API for users,roles and it's permissions update automatization.

Regards

Kanstantsin Chernichenka