View Javadoc

1   /*
2    * Copyright (C) 2014 Atlassian
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.atlassian.jira.rest.client.api;
17  
18  import com.atlassian.jira.rest.client.api.domain.Permissions;
19  import com.atlassian.jira.rest.client.api.domain.input.MyPermissionsInput;
20  import com.atlassian.util.concurrent.Promise;
21  
22  import javax.annotation.Nullable;
23  
24  public interface MyPermissionsRestClient {
25  	/**
26  	 * Returns permissions for current user and context defined by {@code permissionInput}
27  	 * @param permissionInput Permissions context ie. projectKey OR projectId OR issueKey OR issueId.
28  	 *                        <ul>
29  	 *                        <li>When no context supplied (null) the project related permissions will return true
30  	 *                        if the user has that permission in ANY project</li>
31  	 *                        <li>If a project context is provided, project related permissions will return true
32  	 *                        if the user has the permissions in the specified project. For permissions
33  	 *                        that are determined using issue data (e.g Current Assignee), true will be returned
34  	 *                        if the user meets the permission criteria in ANY issue in that project</li>
35  	 *                        <li>If an issue context is provided, it will return whether or not the user
36  	 *                        has each permission in that specific issue</li>
37  	 *                        </ul>
38  	 * @return Permissions for user in the context
39  	 */
40  	Promise<Permissions> getMyPermissions(@Nullable MyPermissionsInput permissionInput);
41  }