I'm trying to create Projects in AEM 6.2 using the new Project API [ https://docs.adobe.com/docs/en/aem/6-2/develop/ref/javadoc/com/adobe/cq/projects/api/Project.html ]
I am able to create the Project and also use a Template that i developed for that Project.
When i am trying to add Users and Roles to the Project using the method
project = projectManager.createProject("/contents/projects", "Project1", "Project Name", "Creating a Test Project", "/apps/myproj/projects/templates/default"); ... List<String> usersIds = ... List<String> rolesIds = ... project.updateMembers(userIds, roleIds);
I tried to map the values in lists 'usersIds' to 'rolesIds', like..
(userId)ksurendra --> (roleId) role_editor
I'm seeing the exceptions like:
Caused by: com.adobe.cq.projects.impl.team.TeamException: The role role_editor is not available for admin.
Appreciate any thoughts on this.
Solved! Go to Solution.
Views
Replies
Total Likes
After some research and testing, i found the solution.
The Solution is to add an Owner to the Project before any Users are assigned to the project.
So when you call
project.updateMembers(userIds, roleIds);
make sure the first values for the userIds and roleIds lists' are of the owner, and then the other users will follow.
For example:
List<String> userIds = new ArrayList<String>{}; userIds.add("suren"); userIds.add("vassu"); List<String> roleIds = new ArrayList<String>{}; userIds.add("owner"); userIds.add("designer");
Some background to the solution.
Views
Replies
Total Likes
After some research and testing, i found the solution.
The Solution is to add an Owner to the Project before any Users are assigned to the project.
So when you call
project.updateMembers(userIds, roleIds);
make sure the first values for the userIds and roleIds lists' are of the owner, and then the other users will follow.
For example:
List<String> userIds = new ArrayList<String>{}; userIds.add("suren"); userIds.add("vassu"); List<String> roleIds = new ArrayList<String>{}; userIds.add("owner"); userIds.add("designer");
Some background to the solution.
Views
Replies
Total Likes
ksuren wrote...
After some research and testing, i found the solution.
The Solution is to add an Owner to the Project before any Users are assigned to the project.
So when you call
project.updateMembers(userIds, roleIds);
make sure the first values for the userIds and roleIds lists' are of the owner, and then the other users will follow.
For example:
List<String> userIds = new ArrayList<String>{};
userIds.add("suren");
userIds.add("vassu");
List<String> roleIds = new ArrayList<String>{};
userIds.add("owner");
userIds.add("designer");
Some background to the solution.
When we create a Project using the API, we need to use a Template. And each of these Templates will have a pre-defined set of Roles. And these Roles will be assigned to the Project (see below).
When we add a User to the above Project, we need to define the "Role" that user will have on the Project. This is the key thing.
Every Project will have a Team, and a Project need to have an Owner before any other Users can be assigned.
Thank you for posting solution here.
~kautuk
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies