summaryrefslogtreecommitdiff
path: root/docs/Classes/SDLPermissionManager.html
blob: 2858dedb8ff899e3ac621ba901b950bdd659e468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<h1>SDLPermissionManager Class Reference</h1>

<h3>Section Contents</h3>

<ul>
  <li><a href="#section-requiresEncryption">requiresEncryption</a></li>
  <li><a href="#section--startWithCompletionHandler:">-startWithCompletionHandler:</a></li>
  <li><a href="#section--stop">-stop</a></li>
  <li><a href="#section--isRPCAllowed:">-isRPCAllowed:</a></li>
  <li><a href="#section--isRPCNameAllowed:">-isRPCNameAllowed:</a></li>
  <li><a href="#section--groupStatusOfRPCs:">-groupStatusOfRPCs:</a></li>
  <li><a href="#section--groupStatusOfRPCPermissions:">-groupStatusOfRPCPermissions:</a></li>
  <li><a href="#section--statusOfRPCs:">-statusOfRPCs:</a></li>
  <li><a href="#section--statusesOfRPCPermissions:">-statusesOfRPCPermissions:</a></li>
  <li><a href="#section--addObserverForRPCs:groupType:withHandler:">-addObserverForRPCs:groupType:withHandler:</a></li>
  <li><a href="#section--subscribeToRPCPermissions:groupType:withHandler:">-subscribeToRPCPermissions:groupType:withHandler:</a></li>
  <li><a href="#section--removeAllObservers">-removeAllObservers</a></li>
  <li><a href="#section--removeObserverForIdentifier:">-removeObserverForIdentifier:</a></li>
  <li><a href="#section--rpcRequiresEncryption:">-rpcRequiresEncryption:</a></li>
  <li><a href="#section--rpcNameRequiresEncryption:">-rpcNameRequiresEncryption:</a></li>
  <li><a href="#section--isPermissionParameterAllowed:parameter:">-isPermissionParameterAllowed:parameter:</a></li>
</ul>

<h3>Overview</h3>

<p>The permission manager monitoring RPC permissions.</p>


<section class="section task-group-section">
  <h3 id="section-requiresEncryption">
      requiresEncryption
  </h3>
  
  <p>Flag indicating if the app requires an encryption service to be active.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">@property</span> <span class="p">(</span><span class="n">nonatomic</span><span class="p">,</span> <span class="n">readonly</span><span class="p">)</span> <span class="n">BOOL</span> <span class="n">requiresEncryption</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="k">var</span> <span class="nv">requiresEncryption</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section--startWithCompletionHandler:">
      -startWithCompletionHandler:
  </h3>
  
  <p>Start the manager with a completion block that will be called when startup completes. This is used internally. To use an SDLPermissionManager, you should use the manager found on <code><a href="../Classes/SDLManager.html">SDLManager</a></code>.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">startWithCompletionHandler</span><span class="p">:</span>
    <span class="p">(</span><span class="n">nonnull</span> <span class="kt">void</span> <span class="p">(</span><span class="o">^</span><span class="p">)(</span><span class="n">BOOL</span><span class="p">,</span> <span class="n">NSError</span> <span class="o">*</span><span class="n">_Nullable</span><span class="p">))</span><span class="nv">completionHandler</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">start</span><span class="p">(</span><span class="nv">completionHandler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Bool</span><span class="p">,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>completionHandler</dt>
      <dd><p>The block to be called when the manager&rsquo;s setup is complete.</p></dd>
  </dl>
  
  <h3 id="section--stop">
      -stop
  </h3>
  
  <p>Stop the manager. This method is used internally.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="n">stop</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>

  
  
  
  <h3 id="section--isRPCAllowed:">
      -isRPCAllowed:
  </h3>
  
  <p>Determine if an individual RPC is allowed for the current HMI level</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="nf">isRPCAllowed</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionRPCName">SDLPermissionRPCName</a></span><span class="p">)</span><span class="nv">rpcName</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">isRPCAllowed</span><span class="p">(</span><span class="n">_</span> <span class="nv">rpcName</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcName</dt>
      <dd><p>The name of the RPC to be tested, for example, SDLShow</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>YES if the RPC is allowed at the current HMI level, NO if not</p>
  </div>
  
  <h3 id="section--isRPCNameAllowed:">
      -isRPCNameAllowed:
  </h3>
  
  <p>Determine if an individual RPC is allowed for the current HMI level</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="nf">isRPCNameAllowed</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">)</span><span class="nv">rpcName</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">isRPCNameAllowed</span><span class="p">(</span><span class="n">_</span> <span class="nv">rpcName</span><span class="p">:</span> <span class="kt"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcName</dt>
      <dd><p>The name of the RPC to be tested, for example, SDLRPCFunctionNameShow</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>YES if the RPC is allowed at the current HMI level, NO if not</p>
  </div>
  
  <h3 id="section--groupStatusOfRPCs:">
      -groupStatusOfRPCs:
  </h3>
  
  <p>Determine if all RPCs are allowed for the current HMI level</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n"><a href="../Enums/SDLPermissionGroupStatus.html">SDLPermissionGroupStatus</a></span><span class="p">)</span><span class="nf">groupStatusOfRPCs</span><span class="p">:</span>
    <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionRPCName">SDLPermissionRPCName</a></span><span class="o">&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">rpcNames</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">groupStatus</span><span class="p">(</span><span class="n">ofRPCs</span> <span class="nv">rpcNames</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/SDLPermissionGroupStatus.html">SDLPermissionGroupStatus</a></span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcNames</dt>
      <dd><p>The RPCs to check</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>AllAllowed if all of the permissions are allowed, AllDisallowed if all the permissions are disallowed, Any if some are allowed, and some are disallowed</p>
  </div>
  
  <h3 id="section--groupStatusOfRPCPermissions:">
      -groupStatusOfRPCPermissions:
  </h3>
  
  <p>Determine if all RPCs are allowed for the current HMI level</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n"><a href="../Enums/SDLPermissionGroupStatus.html">SDLPermissionGroupStatus</a></span><span class="p">)</span><span class="nf">groupStatusOfRPCPermissions</span><span class="p">:</span>
    <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Classes/SDLPermissionElement.html">SDLPermissionElement</a></span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">rpcNames</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">groupStatus</span><span class="p">(</span><span class="n">ofRPCPermissions</span> <span class="nv">rpcNames</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/SDLPermissionElement.html">SDLPermissionElement</a></span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Enums/SDLPermissionGroupStatus.html">SDLPermissionGroupStatus</a></span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcNames</dt>
      <dd><p>The RPCs to check</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>AllAllowed if all of the permissions are allowed, AllDisallowed if all the permissions are disallowed, Any if some are allowed, and some are disallowed</p>
  </div>
  
  <h3 id="section--statusOfRPCs:">
      -statusOfRPCs:
  </h3>
  
  <p>Retrieve a dictionary with keys that are the passed in RPC names, and objects of an NSNumber<BOOL> specifying if that RPC is currently allowed</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSDictionary</span><span class="o">&lt;</span><span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionRPCName">SDLPermissionRPCName</a></span><span class="p">,</span> <span class="n">NSNumber</span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nf">statusOfRPCs</span><span class="p">:</span>
    <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionRPCName">SDLPermissionRPCName</a></span><span class="o">&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">rpcNames</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">status</span><span class="p">(</span><span class="n">ofRPCs</span> <span class="nv">rpcNames</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">NSNumber</span><span class="p">]</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcNames</dt>
      <dd><p>An array of RPC names to check</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>A dictionary specifying if the passed in RPC names are currently allowed or not</p>
  </div>
  
  <h3 id="section--statusesOfRPCPermissions:">
      -statusesOfRPCPermissions:
  </h3>
  
  <p>Retrieve a dictionary with keys that are the passed in RPC names, and objects of an NSNumber<BOOL> specifying if that RPC is currently allowed</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSDictionary</span><span class="o">&lt;</span><span class="n"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">,</span> <span class="n"><a href="../Classes/SDLRPCPermissionStatus.html">SDLRPCPermissionStatus</a></span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span>
    <span class="nf">statusesOfRPCPermissions</span><span class="p">:</span>
        <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Classes/SDLPermissionElement.html">SDLPermissionElement</a></span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">rpcNames</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">statuses</span><span class="p">(</span><span class="n">ofRPCPermissions</span> <span class="nv">rpcNames</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/SDLPermissionElement.html">SDLPermissionElement</a></span><span class="p">])</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span> <span class="p">:</span> <span class="kt"><a href="../Classes/SDLRPCPermissionStatus.html">SDLRPCPermissionStatus</a></span><span class="p">]</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcNames</dt>
      <dd><p>An array of permission elements to check</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>A dictionary with specific RPC info contained in a SDLRPCPermissionStatus</p>
  </div>
  
  <h3 id="section--addObserverForRPCs:groupType:withHandler:">
      -addObserverForRPCs:groupType:withHandler:
  </h3>
  
  <p>Add an observer for specified RPC names, with a callback that will be called whenever the value changes, as well as immediately with the current status.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>This block will be captured by the SDLPermissionsManager, be sure to use <a href="http://www.logicsector.com/ios/avoiding-objc-retain-cycles-with-weakself-and-strongself-the-easy-way/">weakself/strongself</a> if you are referencing self within your observer block.</p>

</div><div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>The observer may be called before this method returns, do not attempt to remove the observer from within the observer. That could send <code>nil</code> to removeObserverForIdentifier:. If you want functionality like that, call groupStatusOfRPCs: instead.</p>

</div>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionObserverIdentifier">SDLPermissionObserverIdentifier</a></span><span class="p">)</span>
    <span class="nf">addObserverForRPCs</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionRPCName">SDLPermissionRPCName</a></span><span class="o">&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">rpcNames</span>
             <span class="nf">groupType</span><span class="p">:(</span><span class="n"><a href="../Enums/SDLPermissionGroupType.html">SDLPermissionGroupType</a></span><span class="p">)</span><span class="nv">groupType</span>
           <span class="nf">withHandler</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionsChangedHandler">SDLPermissionsChangedHandler</a></span><span class="p">)</span><span class="nv">handler</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">addObserver</span><span class="p">(</span><span class="n">forRPCs</span> <span class="nv">rpcNames</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">],</span> <span class="nv">groupType</span><span class="p">:</span> <span class="kt"><a href="../Enums/SDLPermissionGroupType.html">SDLPermissionGroupType</a></span><span class="p">,</span> <span class="n">withHandler</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionsChangedHandler">SDLPermissionsChangedHandler</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">UUID</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcNames</dt>
      <dd><p>The RPCs to be observed</p></dd>
      <dt>groupType</dt>
      <dd><p>Affects the times that the observer block will be called. If Any, any change to any RPC in rpcNames will cause the observer block to be called. If AllAllowed, the block will be called when: 1. The observer is first set regardless of RPC status  2. Every RPC in rpcNames becomes allowed 3. The group of rpcNames goes from all being allowed to some or all being disallowed.</p></dd>
      <dt>handler</dt>
      <dd><p>The block that will be called whenever permissions change.</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An identifier that can be passed to removeObserverForIdentifer: to remove the observer</p>
  </div>
  
  <h3 id="section--subscribeToRPCPermissions:groupType:withHandler:">
      -subscribeToRPCPermissions:groupType:withHandler:
  </h3>
  
  <p>Subscribe to specified RPC names, with a callback that will be called whenever the value changes. Unlike addObserverForRPCs:groupType:withHandler:, the callback will only return immediately if the groupType is set to SDLPermissionGroupTypeAny or if the groupType is set to SDLPermissionGroupTypeAllAllowed and all RPCs in the rpcNames parameter are allowed.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>The observer may be called before this method returns, do not attempt to remove the observer from within the observer. That could send <code>nil</code> to removeObserverForIdentifier:. If you want functionality like that, call groupStatusOfRPCs: instead.</p>

</div>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionObserverIdentifier">SDLPermissionObserverIdentifier</a></span><span class="p">)</span>
    <span class="nf">subscribeToRPCPermissions</span><span class="p">:</span>
        <span class="p">(</span><span class="n">nonnull</span> <span class="n">NSArray</span><span class="o">&lt;</span><span class="n"><a href="../Classes/SDLPermissionElement.html">SDLPermissionElement</a></span> <span class="o">*&gt;</span> <span class="o">*</span><span class="p">)</span><span class="nv">permissionElements</span>
                    <span class="nf">groupType</span><span class="p">:(</span><span class="n"><a href="../Enums/SDLPermissionGroupType.html">SDLPermissionGroupType</a></span><span class="p">)</span><span class="nv">groupType</span>
                  <span class="nf">withHandler</span><span class="p">:</span>
                      <span class="p">(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLRPCPermissionStatusChangedHandler">SDLRPCPermissionStatusChangedHandler</a></span><span class="p">)</span><span class="nv">handler</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">subscribe</span><span class="p">(</span><span class="n">toRPCPermissions</span> <span class="nv">permissionElements</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Classes/SDLPermissionElement.html">SDLPermissionElement</a></span><span class="p">],</span> <span class="nv">groupType</span><span class="p">:</span> <span class="kt"><a href="../Enums/SDLPermissionGroupType.html">SDLPermissionGroupType</a></span><span class="p">,</span> <span class="n">withHandler</span> <span class="nv">handler</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kt"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLRPCPermissionStatusChangedHandler">SDLRPCPermissionStatusChangedHandler</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">UUID</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>permissionElements</dt>
      <dd><p>The permission elements to be observed</p></dd>
      <dt>groupType</dt>
      <dd><p>Affects the times that the observer block will be called. If Any, any change to any RPC in rpcNames will cause the observer block to be called. If AllAllowed, the block will be called when: 1. Every RPC in rpcNames becomes allowed 2. The group of rpcNames goes from all being allowed to some or all being disallowed.</p></dd>
      <dt>handler</dt>
      <dd><p>The block that will be called whenever permissions change.</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>An identifier that can be passed to removeObserverForIdentifer: to remove the observer</p>
  </div>
  
  <h3 id="section--removeAllObservers">
      -removeAllObservers
  </h3>
  
  <p>Remove every current observer</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="n">removeAllObservers</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">removeAllObservers</span><span class="p">()</span></code></pre>

  
  
  
  <h3 id="section--removeObserverForIdentifier:">
      -removeObserverForIdentifier:
  </h3>
  
  <p>Remove block observers for the specified RPC</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nf">removeObserverForIdentifier</span><span class="p">:</span>
    <span class="p">(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionObserverIdentifier">SDLPermissionObserverIdentifier</a></span><span class="p">)</span><span class="nv">identifier</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">removeObserver</span><span class="p">(</span><span class="n">forIdentifier</span> <span class="nv">identifier</span><span class="p">:</span> <span class="kt">UUID</span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>identifier</dt>
      <dd><p>The identifier specifying which observer to remove</p></dd>
  </dl>
  
  <h3 id="section--rpcRequiresEncryption:">
      -rpcRequiresEncryption:
  </h3>
  
  <p>Check whether or not an RPC needs encryption.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="nf">rpcRequiresEncryption</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLPermissionConstants.h@T@SDLPermissionRPCName">SDLPermissionRPCName</a></span><span class="p">)</span><span class="nv">rpcName</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">rpcRequiresEncryption</span><span class="p">(</span><span class="n">_</span> <span class="nv">rpcName</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  
  <h3 id="section--rpcNameRequiresEncryption:">
      -rpcNameRequiresEncryption:
  </h3>
  
  <p>Check whether or not an RPC needs encryption.</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="nf">rpcNameRequiresEncryption</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">)</span><span class="nv">rpcName</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">rpcNameRequiresEncryption</span><span class="p">(</span><span class="n">_</span> <span class="nv">rpcName</span><span class="p">:</span> <span class="kt"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  
  <h3 id="section--isPermissionParameterAllowed:parameter:">
      -isPermissionParameterAllowed:parameter:
  </h3>
  
  <p>Check whether a parameter of an RPC is allowed</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight objective_c"><code><span class="k">-</span> <span class="p">(</span><span class="n">BOOL</span><span class="p">)</span><span class="nf">isPermissionParameterAllowed</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">)</span><span class="nv">rpcName</span>
                           <span class="nf">parameter</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nv">parameter</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">isPermissionParameterAllowed</span><span class="p">(</span><span class="n">_</span> <span class="nv">rpcName</span><span class="p">:</span> <span class="kt"><a href="../Type%20Definitions.html#/c:SDLRPCFunctionNames.h@T@SDLRPCFunctionName">SDLRPCFunctionName</a></span><span class="p">,</span> <span class="nv">parameter</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>rpcName</dt>
      <dd><p>The name of the RPC to be tested, for example, SDLRPCFunctionNameGetVehicleData</p></dd>
      <dt>parameter</dt>
      <dd><p>The name of the parameter to be tested, for example, rpm</p></dd>
  </dl>
  <div>
    <h4>Return Value</h4>
    <p>True if the parameter is allowed, false if it is not</p>
  </div>
  
</section>