Sha256: a40e5689d92e72b41828e8606ff0b4984f6d2661aca9b7858f8d562a83295908

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

module TeamworkApi
  module API
    module People
      def add_person_to_project(project_id, person_id)
        response =
          put "projects/#{project_id}/people.json",
              { add: { userIdList: person_id } }
        response.body['STATUS']
      end

      def set_permissions(project_id, person_id, args)
        args =
          API.params(args)
             .optional(
               :'edit-all-tasks',
               :'view-messages-and-files',
               :'view-tasks-and-milestones',
               :'view-time',
               :'view-notebooks',
               :'view-risk-register',
               :'view-invoices',
               :'view-links',
               :'view-links',
               :'add-tasks',
               :'add-milestones',
               :'add-taskLists',
               :'add-messages',
               :'add-files',
               :'add-time',
               :'add-notebooks',
               :'add-links',
               :'set-privacy',
               :'set-privacy',
               :'is-observing',
               :'can-be-assigned-to-tasks-and-milestones',
               :'project-administrator',
               :'add-people-to-project'
             ).to_h

        response =
          put "projects/#{project_id}/people/#{person_id}.json",
              permissions: args
        response.body
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
teamwork_api-0.1.0 lib/teamwork_api/api/people.rb