I want to change the userWorkspace folder(physical) name with my own name. As per Nuxeo it is coming as a Username now.

I want to change the userWorkspace folder(physical) name with my own name. As per Nuxeo it is coming as a Username now. Please see the below URL for reference.

http://localhost:8080/nuxeo/nxpath/default/tenant-test/UserWorkspaces/12345@view_documents?tabIds=CLOUDDESK_MAIN_TABS%3Aclouddesk_my_documents&conversationId=0NXMAIN

after this I am seeing my folder name as a 12345 from server side.

For this requirement I changed the below code for changing the server side URL.

protected static String getUserWorkspaceNameForUser(String userName) {

    return IdUtils.generateId("MyDocs", "-", false, 30);
}

After changing above code I logged in as a Administrator and below is the URL and I can able to see physical folder name as a MyDocs .

http://localhost:8080/nuxeo/nxpath/default/tenant-test/UserWorkspaces/MyDocs@view_documents?tabIds=CLOUDDESK_MAIN_TABS%3Aclouddesk_my_documents&conversationId=0NXMAIN

Above url is for Administrator , when I login as a user it is showing the below error.

org.nuxeo.ecm.core.api.DocumentSecurityException. message: Privilege 'Read' is not granted to 'ravi'

Please sugget or help me, how to add permissions to users in the above scenario.

0 votes

2 answers

984 views

ANSWER



Below method i m extending and trying like this now.

protected static String myGetUserWorkspaceNameForUser(String userName) { return IdUtils.generateId(fullName, “-“, false, 30); }

Above i m using fullname for userworkspace name in that case folder name is differant rite?

0 votes



Hi,

If you change the code in a way that makes all user workspaces having the same name, then Administrator and “Ravi” will have the same user Workspace Object. But since Adminsitrator created it first, the Ravi as not rights on it :)

The idea is that the getUserWorkspaceNameForUser method should actually return something that do depend on the user, otherwise you will have more changes to do in the UserWorkspaceService implementation you contribute.

By the way, you do contribute a new Service extension / implementation, you don't directly change inside the original source code, right ?

Tiry

0 votes