@@ -18,14 +18,21 @@ class Notify implements \JsonSerializable
18
18
/** @var array|null */
19
19
public $ groups ;
20
20
21
+ /** @var array */
22
+ public $ restrict ;
23
+
21
24
public function __construct ()
22
25
{
23
26
$ this ->to = [];
24
27
$ this ->to ['users ' ] = [];
25
- $ this ->groups = [];
28
+ $ this ->to ['groups ' ] = [];
29
+
30
+ $ this ->restrict = [];
31
+ $ this ->restrict ['groups ' ] = [];
32
+ $ this ->restrict ['permissions ' ] = [];
26
33
27
- $ this ->to ['reporter ' ] = false ;
28
- $ this ->to ['assignee ' ] = false ;
34
+ $ this ->to ['reporter ' ] = true ;
35
+ $ this ->to ['assignee ' ] = true ;
29
36
$ this ->to ['watchers ' ] = true ;
30
37
$ this ->to ['voters ' ] = true ;
31
38
}
@@ -82,10 +89,26 @@ public function sendToUser($name, $active)
82
89
public function sendToGroup ($ groupName )
83
90
{
84
91
$ group ['name ' ] = $ groupName ;
85
- // FIXME "self": "http://www.example.com/jira/rest/api/2/group?groupname=notification-group"
86
- //$group['self'] = $active;
87
92
88
- array_push ($ this ->groups , $ group );
93
+ array_push ($ this ->to ['groups ' ], $ group );
94
+
95
+ return $ this ;
96
+ }
97
+
98
+ public function setRestrictGroup ($ groupName )
99
+ {
100
+ $ group ['name ' ] = $ groupName ;
101
+
102
+ array_push ($ this ->restrict ['groups ' ], $ group );
103
+
104
+ return $ this ;
105
+ }
106
+
107
+ public function setRestrictPermission ($ id , $ key )
108
+ {
109
+ $ perm ['id ' ] = $ id ;
110
+ $ perm ['key ' ] = $ key ;
111
+ array_push ($ this ->restrict ['permissions ' ], $ perm );
89
112
90
113
return $ this ;
91
114
}
0 commit comments