• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tylernathanreed / jira-client-php / 13634794100

03 Mar 2025 03:19PM UTC coverage: 2.067% (-0.1%) from 2.21%
13634794100

push

github

web-flow
~ Try coveralls action

140 of 6773 relevant lines covered (2.07%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Operations/ProjectPermissionSchemes.php
1
<?php
2

3
namespace Jira\Client\Operations;
4

5
use Jira\Client\Client;
6
use Jira\Client\Schema;
7

8
/** @phpstan-require-extends Client */
9
trait ProjectPermissionSchemes
10
{
11
    /**
12
     * Returns the "issue security scheme" associated with the project
13
     * 
14
     * **"Permissions" required:** *Administer Jira* "global permission" or the *Administer Projects* "project permission".
15
     * 
16
     * @link https://confluence.atlassian.com/x/J4lKLg
17
     * @link https://confluence.atlassian.com/x/x4dKLg
18
     * @link https://confluence.atlassian.com/x/yodKLg
19
     * 
20
     * @param string $projectKeyOrId The project ID or project key (case sensitive).
21
     */
22
    public function getProjectIssueSecurityScheme(
×
23
        string $projectKeyOrId,
24
    ): Schema\SecurityScheme {
25
        return $this->call(
×
26
            uri: '/rest/api/3/project/{projectKeyOrId}/issuesecuritylevelscheme',
×
27
            method: 'get',
×
28
            path: compact('projectKeyOrId'),
×
29
            success: 200,
×
30
            schema: Schema\SecurityScheme::class,
×
31
        );
×
32
    }
33

34
    /**
35
     * Gets the "permission scheme" associated with the project
36
     * 
37
     * **"Permissions" required:** *Administer Jira* "global permission" or *Administer projects* "project permission".
38
     * 
39
     * @link https://confluence.atlassian.com/x/yodKLg
40
     * @link https://confluence.atlassian.com/x/x4dKLg
41
     * @link https://confluence.atlassian.com/x/yodKLg
42
     * 
43
     * @param string $projectKeyOrId The project ID or project key (case sensitive).
44
     * @param string $expand Use "expand" to include additional information in the response.
45
     *                       This parameter accepts a comma-separated list.
46
     *                       Note that permissions are included when you specify any value.
47
     *                       Expand options include:
48
     *                        - `all` Returns all expandable information
49
     *                        - `field` Returns information about the custom field granted the permission
50
     *                        - `group` Returns information about the group that is granted the permission
51
     *                        - `permissions` Returns all permission grants for each permission scheme
52
     *                        - `projectRole` Returns information about the project role granted the permission
53
     *                        - `user` Returns information about the user who is granted the permission.
54
     */
55
    public function getAssignedPermissionScheme(
×
56
        string $projectKeyOrId,
57
        ?string $expand = null,
58
    ): Schema\PermissionScheme {
59
        return $this->call(
×
60
            uri: '/rest/api/3/project/{projectKeyOrId}/permissionscheme',
×
61
            method: 'get',
×
62
            query: compact('expand'),
×
63
            path: compact('projectKeyOrId'),
×
64
            success: 200,
×
65
            schema: Schema\PermissionScheme::class,
×
66
        );
×
67
    }
68

69
    /**
70
     * Assigns a permission scheme with a project.
71
     * See "Managing project permissions" for more information about permission schemes
72
     * 
73
     * **"Permissions" required:** *Administer Jira* "global permission"
74
     * 
75
     * @link https://confluence.atlassian.com/x/yodKLg
76
     * @link https://confluence.atlassian.com/x/x4dKLg
77
     * 
78
     * @param string $projectKeyOrId The project ID or project key (case sensitive).
79
     * @param string $expand Use "expand" to include additional information in the response.
80
     *                       This parameter accepts a comma-separated list.
81
     *                       Note that permissions are included when you specify any value.
82
     *                       Expand options include:
83
     *                        - `all` Returns all expandable information
84
     *                        - `field` Returns information about the custom field granted the permission
85
     *                        - `group` Returns information about the group that is granted the permission
86
     *                        - `permissions` Returns all permission grants for each permission scheme
87
     *                        - `projectRole` Returns information about the project role granted the permission
88
     *                        - `user` Returns information about the user who is granted the permission.
89
     */
90
    public function assignPermissionScheme(
×
91
        Schema\IdBean $request,
92
        string $projectKeyOrId,
93
        ?string $expand = null,
94
    ): Schema\PermissionScheme {
95
        return $this->call(
×
96
            uri: '/rest/api/3/project/{projectKeyOrId}/permissionscheme',
×
97
            method: 'put',
×
98
            body: $request,
×
99
            query: compact('expand'),
×
100
            path: compact('projectKeyOrId'),
×
101
            success: 200,
×
102
            schema: Schema\PermissionScheme::class,
×
103
        );
×
104
    }
105

106
    /**
107
     * Returns all "issue security" levels for the project that the user has access to
108
     * 
109
     * This operation can be accessed anonymously
110
     * 
111
     * **"Permissions" required:** *Browse projects* "global permission" for the project, however, issue security levels are only returned for authenticated user with *Set Issue Security* "global permission" for the project.
112
     * 
113
     * @link https://confluence.atlassian.com/x/J4lKLg
114
     * @link https://confluence.atlassian.com/x/x4dKLg
115
     * 
116
     * @param string $projectKeyOrId The project ID or project key (case sensitive).
117
     */
118
    public function getSecurityLevelsForProject(
×
119
        string $projectKeyOrId,
120
    ): Schema\ProjectIssueSecurityLevels {
121
        return $this->call(
×
122
            uri: '/rest/api/3/project/{projectKeyOrId}/securitylevel',
×
123
            method: 'get',
×
124
            path: compact('projectKeyOrId'),
×
125
            success: 200,
×
126
            schema: Schema\ProjectIssueSecurityLevels::class,
×
127
        );
×
128
    }
129
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc