Pro Android with Kotlin


Securing all content by one criterion


Download 5.42 Mb.
Pdf ko'rish
bet86/223
Sana04.11.2023
Hajmi5.42 Mb.
#1746807
1   ...   82   83   84   85   86   87   88   89   ...   223
Bog'liq
@de android telegram Pro Android with Kotlin Developing Modern Mobile

Securing all content by one criterion
To do so, use the permission attribute of 
 as follows:
android:permission="PERMISSION-NAME"
... >
...
Here, PERMISSION-NAME is a system permission or a permission you defined in the 
element of the app. If you do it that way, the complete content of the provider 
is accessible only to such clients that successfully acquired exactly this permission. More 
precisely, any read or write access requires clients to have this permission. If you need 
to distinguish between read permission and write permission, you can instead use the 
readPermission and writePermission attributes. If you use a mixture, the more specific 
attributes win.

permission = A ® writePermission = A, readPermission = A

permission = A, readPermission = B ® writePermission = A, 
readPermission = B

permission = A, writePermission = B ® writePermission = B, 
readPermission = A

permission = A, writePermission = B, readPermission = C ® 
writePermission = B, readPermission = C
2. 
Securing specific URI paths
By using the 
 subelement of 
, you can impose 
restrictions on specific URI paths.
android:pathPrefix="string"
android:pathPattern="string"
android:permission="string"
android:readPermission="string"
android:writePermission="string" />
In the *permission attributes, you specify the permission name and permission 
scope, just as described earlier for securing all content by one criterion. For the 
path specification, you use exactly one of the three possible attributes: path is 
for an exact path match, path- Prefix is for matching the start of a path, and 
pathPattern allows for wildcards (X* is for zero to many occurrences of any 
character X, and .* is for zero to many occurrences of any character). Since 
you can use several 
 elements, you can build a fine-grained 
permission structure in your content provider.



Download 5.42 Mb.

Do'stlaringiz bilan baham:
1   ...   82   83   84   85   86   87   88   89   ...   223




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling