This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Permissions in Teamwork
Overview
The following operations allow you to work with project permissions. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with attachments, see Sample configuration.
Operation | Description |
---|---|
addUserToProject | Add a user to a project. |
removeUserFromProject | Removes a user from a project. |
updateUserPermissionOnProject | Sets the permissions of a given user on a given project. |
getUserPermissionsOnProject | Gets the details and permissions for a given user on a given project. |
Operation details
This section provides further details on the operations related to discussions.
Adding a user to project
The addUserToProject
operation adds a user to project.
<teamwork.addUserToProject> <projectId>{$ctx:projectId}</projectId> <userId>{$ctx:userId}</userId> </teamwork.addUserToProject>
Properties
projectId
: The id of the project.userId
: The id of the user.
Sample Request
Following is a sample REST/JSON request that can be handled by the addUserToProject
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538", "userId": "149146" }
Related Teamwork documentation
http://developer.teamwork.com/permissions#add_a_new_user_to
Removing a user from project
The removeUserFromProject
operation removes a user to project.
<teamwork.addUserToProject> <projectId>{$ctx:projectId}</projectId> <userId>{$ctx:userId}</userId> </teamwork.addUserToProject>
Properties
projectId
: The id of the project.userId
: The id of the user.
Sample Request
Following is a sample REST/JSON request that can be handled by the removeUserFromProject
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538", "userId": "149146" }
Related Teamwork documentation
http://developer.teamwork.com/permissions#remove_a_user_fro
Updating user's permissions on project
The updateUserPermissionOnProject
operation update the user permissions on project.
<teamwork.updateUserPermissionOnProject> <projectId>{$ctx:projectId}</projectId> <userId>{$ctx:userId}</userId> <viewMessagesAndFiles>{$ctx:viewMessagesAndFiles}</viewMessagesAndFiles> <viewTasksAndMilestones>{$ctx:viewTasksAndMilestones}</viewTasksAndMilestones> <viewTime>{$ctx:viewTime}</viewTime> <viewNotebooks>{$ctx:viewNotebooks}</viewNotebooks> <viewRiskRegister>{$ctx:viewRiskRegister}</viewRiskRegister> <viewInvoices>{$ctx:viewInvoices}</viewInvoices> <viewLinks>{$ctx:viewLinks}</viewLinks> <addTasks>{$ctx:addTasks}</addTasks> <addMilestones>{$ctx:addMilestones}</addMilestones> <addTaskLists>{$ctx:addTaskLists}</addTaskLists> <addMessages>{$ctx:addMessages}</addMessages> <addFiles>{$ctx:addFiles}</addFiles> <addTime>{$ctx:addTime}</addTime> <addNotebooks>{$ctx:addNotebooks}</addNotebooks> <addLinks>{$ctx:addLinks}</addLinks> <setPrivacy>{$ctx:setPrivacy}</setPrivacy> <canBeAssignedToTasksAndMilestones>{$ctx:canBeAssignedToTasksAndMilestones}</canBeAssignedToTasksAndMilestones> <projectAdministrator>{$ctx:projectAdministrator}</projectAdministrator> <addPeopleToProject>{$ctx:addPeopleToProject}</addPeopleToProject> </teamwork.updateUserPermissionOnProject>
Properties
projectId
: The id of the project.userId
: The id of the user.- viewMessagesAndFiles: Whether user can view messages and files of the project.
viewTasksAndMilestones: Whether user can view tasks and milestones of the project.
viewTime: Whether user can view time of the project.
viewNotebooks: Whether user can view notebooks of the project.
viewRiskRegister: Whether user can view risk register of the project.
viewInvoices: Whether user can view invoices of the project.
viewLinks: Whether user can view links of the project.
addTasks: Whether user can add tasks to the project.
addMilestones: Whether user can add milestones to the project.
addTaskLists: Whether user can add task lists the project.
addMessages: Whether user can add messages to the project.
addFiles: Whether user can add files to the project.
addTime: Whether user can add time the project.
addNotebooks: Whether user can add notebooks to the project.
addLinks: Whether user can add links to the project.
setPrivacy: Whether user can set privacynto the project.
canBeAssignedToTasksAndMilestones: Whether user can assigned to tasks and milestones of the project.
projectAdministrator: Whether user can be administrator of the project.
addPeopleToProject: Whether user can add people to the project.
Sample Request
Following is a sample REST/JSON request that can be handled by the updateUserPermissionOnProject
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId":"90538", "userId":"149146", "viewMessagesAndFiles": "1", "viewTasksAndMilestones": "1", "viewTime": "1", "viewNotebooks": "1", "viewRiskRegister": "1", "viewInvoices": "1", "viewLinks": "1", "addTasks": "1", "addMilestones": "1", "addTaskLists": "1", "addMessages": "1", "addFiles": "1", "addTime": "1", "addNotebooks": "1", "addLinks": "1", "setPrivacy": "1", "canBeAssignedToTasksAndMilestones": "1", "projectAdministrator": "1", "addPeopleToProject": "1" }
Related Teamwork documentation
http://developer.teamwork.com/permissions#update_a_users_pe
Retrieving user permission on project
The getUserPermissionsOnProject
operation retrieves the user's permissions on a project.
<teamwork.getUserPermissionsOnProject> <projectId>{$ctx:projectId}</projectId> <userId>{$ctx:userId}</userId> </teamwork.getUserPermissionsOnProject>
Properties
projectId
: The id of the project.userId
: The id of the user.
Sample Request
Following is a sample REST/JSON request that can be handled by the getUserPermissionsOnProject
operation.
{ "apiUrl":"https://wso2test.teamwork.com/", "apiKey":"clark42ceiling", "projectId": "90538", "userId": "149146" }
Related Teamwork documentation
http://developer.teamwork.com/permissions#get_a_users_permi
Sample configuration
Following is a sample proxy service that illustrates how to connect to Teamwork with the init
operation and use the updateUserPermissionOnProject
operation. The sample request for this proxy can be found in updateUserPermissionOnProject sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="tw_updateUserPermissionOnProject" transports="https http" startOnLoad="true" trace="disable"> <description/> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="projectId" expression="json-eval($.projectId)"/> <property name="userId" expression="json-eval($.userId)"/> <property name="viewMessagesAndFiles" expression="json-eval($.viewMessagesAndFiles)"/> <property name="viewTasksAndMilestones" expression="json-eval($.viewTasksAndMilestones)"/> <property name="viewTime" expression="json-eval($.viewTime)"/> <property name="viewNotebooks" expression="json-eval($.viewNotebooks)"/> <property name="viewRiskRegister" expression="json-eval($.viewRiskRegister)"/> <property name="viewInvoices" expression="json-eval($.viewInvoices)"/> <property name="viewLinks" expression="json-eval($.viewLinks)"/> <property name="addTasks" expression="json-eval($.addTasks)"/> <property name="addMilestones" expression="json-eval($.addMilestones)"/> <property name="addTaskLists" expression="json-eval($.addTaskLists)"/> <property name="addMessages" expression="json-eval($.addMessages)"/> <property name="addFiles" expression="json-eval($.addFiles)"/> <property name="addTime" expression="json-eval($.addTime)"/> <property name="addNotebooks" expression="json-eval($.addNotebooks)"/> <property name="addLinks" expression="json-eval($.addLinks)"/> <property name="setPrivacy" expression="json-eval($.setPrivacy)"/> <property name="canBeAssignedToTasksAndMilestones" expression="json-eval($.canBeAssignedToTasksAndMilestones)"/> <property name="projectAdministrator" expression="json-eval($.projectAdministrator)"/> <property name="addPeopleToProject" expression="json-eval($.addPeopleToProject)"/> <teamwork.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </teamwork.init> <teamwork.updateUserPermissionOnProject> <projectId>{$ctx:projectId}</projectId> <userId>{$ctx:userId}</userId> <viewMessagesAndFiles>{$ctx:viewMessagesAndFiles}</viewMessagesAndFiles> <viewTasksAndMilestones>{$ctx:viewTasksAndMilestones}</viewTasksAndMilestones> <viewTime>{$ctx:viewTime}</viewTime> <viewNotebooks>{$ctx:viewNotebooks}</viewNotebooks> <viewRiskRegister>{$ctx:viewRiskRegister}</viewRiskRegister> <viewInvoices>{$ctx:viewInvoices}</viewInvoices> <viewLinks>{$ctx:viewLinks}</viewLinks> <addTasks>{$ctx:addTasks}</addTasks> <addMilestones>{$ctx:addMilestones}</addMilestones> <addTaskLists>{$ctx:addTaskLists}</addTaskLists> <addMessages>{$ctx:addMessages}</addMessages> <addFiles>{$ctx:addFiles}</addFiles> <addTime>{$ctx:addTime}</addTime> <addNotebooks>{$ctx:addNotebooks}</addNotebooks> <addLinks>{$ctx:addLinks}</addLinks> <setPrivacy>{$ctx:setPrivacy}</setPrivacy> <canBeAssignedToTasksAndMilestones>{$ctx:canBeAssignedToTasksAndMilestones}</canBeAssignedToTasksAndMilestones> <projectAdministrator>{$ctx:projectAdministrator}</projectAdministrator> <addPeopleToProject>{$ctx:addPeopleToProject}</addPeopleToProject> </teamwork.updateUserPermissionOnProject> <respond/> </inSequence> <outSequence/> <faultSequence/> </target> </proxy>