Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsonrpc
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
jsonrpc
Merge requests
!43
Draft: Migrate from annotations to attributes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Draft: Migrate from annotations to attributes
issue/jsonrpc-3471347:attributes
into
3.x
Overview
0
Commits
40
Pipelines
21
Changes
15
Open
Patrick Kenny
requested to merge
issue/jsonrpc-3471347:attributes
into
3.x
8 months ago
Overview
0
Commits
40
Pipelines
21
Changes
15
Expand
0
0
Merge request reports
Compare
3.x
version 20
1863eee9
6 months ago
version 19
9370e8db
6 months ago
version 18
a0381719
6 months ago
version 17
65c0cfaf
6 months ago
version 16
f08280ae
7 months ago
version 15
ee91ed56
7 months ago
version 14
231ce5d3
7 months ago
version 13
462cc78a
7 months ago
version 12
ac24e629
7 months ago
version 11
a26a45bf
7 months ago
version 10
4b2553bb
7 months ago
version 9
2adcd986
7 months ago
version 8
7f987faa
7 months ago
version 7
a952bd9d
7 months ago
version 6
e7ef2316
7 months ago
version 5
85088915
8 months ago
version 4
0c54f029
8 months ago
version 3
203bdbb5
8 months ago
version 2
59bb14be
8 months ago
version 1
16ff87ec
8 months ago
3.x (HEAD)
and
latest version
latest version
55ef10b3
40 commits,
6 months ago
version 20
1863eee9
39 commits,
6 months ago
version 19
9370e8db
38 commits,
6 months ago
version 18
a0381719
37 commits,
6 months ago
version 17
65c0cfaf
36 commits,
6 months ago
version 16
f08280ae
36 commits,
7 months ago
version 15
ee91ed56
35 commits,
7 months ago
version 14
231ce5d3
33 commits,
7 months ago
version 13
462cc78a
30 commits,
7 months ago
version 12
ac24e629
29 commits,
7 months ago
version 11
a26a45bf
28 commits,
7 months ago
version 10
4b2553bb
27 commits,
7 months ago
version 9
2adcd986
26 commits,
7 months ago
version 8
7f987faa
23 commits,
7 months ago
version 7
a952bd9d
21 commits,
7 months ago
version 6
e7ef2316
20 commits,
7 months ago
version 5
85088915
19 commits,
8 months ago
version 4
0c54f029
16 commits,
8 months ago
version 3
203bdbb5
15 commits,
8 months ago
version 2
59bb14be
7 commits,
8 months ago
version 1
16ff87ec
6 commits,
8 months ago
15 files
+
351
−
45
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
15
Search (e.g. *.vue) (Ctrl+P)
modules/jsonrpc_core/src/Plugin/jsonrpc/Method/AddPermissionToRole.php
+
20
−
0
Options
@@ -5,9 +5,13 @@ declare(strict_types=1);
namespace
Drupal\jsonrpc_core\Plugin\jsonrpc\Method
;
use
Drupal\Core\Entity\EntityStorageException
;
use
Drupal\Core\StringTranslation\TranslatableMarkup
;
use
Drupal\jsonrpc\Attribute\JsonRpcMethod
;
use
Drupal\jsonrpc\Attribute\JsonRpcParameterDefinition
;
use
Drupal\jsonrpc\Exception\JsonRpcException
;
use
Drupal\jsonrpc\JsonRpcObject\Error
;
use
Drupal\jsonrpc\JsonRpcObject\ParameterBag
;
use
Drupal\jsonrpc\ParameterFactory\EntityParameterFactory
;
use
Symfony\Component\Validator\ConstraintViolationInterface
;
/**
@@ -23,6 +27,22 @@ use Symfony\Component\Validator\ConstraintViolationInterface;
* }
* )
*/
#
[
JsonRpcMethod
(
id
:
"user_permissions.add_permission_to_role"
,
usage
:
new
TranslatableMarkup
(
"Add the given permission to the specified role."
),
access
:
[
"administer permissions"
],
params
:
[
'permission'
=>
new
JsonRpcParameterDefinition
(
'permission'
,
[
"type"
=>
"string"
],
),
'role'
=>
new
JsonRpcParameterDefinition
(
'role'
,
NULL
,
EntityParameterFactory
::
class
,
),
]
)]
class
AddPermissionToRole
extends
UserPermissionsBase
{
/**
Loading