Fix spelling and images size.
[src/app-framework-main.git] / docs / 3-permissions.md
1 The permissions
2 ===============
3
4
5 Permission's names
6 ------------------
7
8 The proposal here is to specify a naming scheme for permissions
9 that allows the system to be as stateless as possible. The current
10 specification includes in the naming of permissions either
11 the name of the bound binding when existing and the level of the
12 permission itself. Doing this, there is no real need for the
13 framework to keep installed permissions in a database.
14
15 The permission names are [URN][URN] of the form:
16
17         urn:AGL:permission:<api>:<level>:<hierarchical-name>
18
19 where "AGL" is the NID (the namespace identifier) dedicated to
20 AGL (note: a RFC should be produced to standardize this name space).
21
22 The permission names are made of NSS (the namespace specific string)
23 starting with "permission:" and followed by colon separated
24 fields. The 2 first fields are `<api>` and `<level>` and the remaining
25 fields are grouped to form the `<hierarchical-name>`.
26
27         <api> ::= [ <pname> ]
28
29         <pname> ::= 1*<pchars>
30
31         <pchars> ::= <upper> | <lower> | <number> | <extra>
32
33         <extra> ::= "-" | "." | "_" | "@"
34
35 The field `<api>` can be made of any valid character for NSS except
36 the characters colon and star (:*). This field designates the api
37 providing the permission. This scheme is used to deduce binding requirements
38 from permission requirements. The field `<api>` can be the empty
39 string when the permission is defined by the AGL system itself.
40
41 [PROPOSAL 1] The field `<api>` if starting with the character "@" represents
42 a transversal/cross permission not bound to any binding.
43
44 [PROPOSAL 2]The field `<api>` if starting with the 2 characters "@@"
45 in addition to a permission not bound to any binding, represents a
46 permission that must be set at installation and that can not be
47 revoked later.
48
49         <level> ::= 1*<lower>
50
51 The field `<level>` is made only of letters in lower case.
52 The field `<level>` can only take some predefined values:
53
54  - system
55  - platform
56  - partner
57  - tiers
58  - owner
59  - public
60
61 The field `<hierarchical-name>` is made of `<pname>` separated
62 by colons.
63
64         <hierarchical-name> ::= <pname> 0*(":" <pname>)
65
66 The names at left are hierarchically grouping the
67 names at right. This hierarchical behaviour is intended to
68 be used to request permissions using hierarchical grouping.
69
70
71 Permission value
72 ----------------
73
74 In some case, it could be worth to add a value to a permission.
75
76 Currently, the framework allows it for permissions linked to
77 systemd. But this not currently used.
78
79 Conversely, permissions linked to cynara can't carry data
80 except in their name.
81
82 Thus to have a simple and cleaner model, it is better to forbid
83 attachment of value to permission.
84
85
86 Example of permissions
87 ----------------------
88
89 Here is a list of some possible permissions. These
90 permissions are available the 17th of March 2017.
91
92  - urn:AGL:permission::platform:no-oom
93
94    Set OOMScoreAdjust=-500 to keep the out-of-memory
95    killer away.
96
97  - urn:AGL:permission::partner:real-time
98
99    Set IOSchedulingClass=realtime to give to the process
100    realtime scheduling.
101
102    Conversely, not having this permission set RestrictRealtime=on
103    to forbid realtime features.
104
105  - urn:AGL:permission::public:display
106
107    Adds the group "display" to the list of supplementary groups
108    of the process.
109
110  - urn:AGL:permission::public:syscall:clock
111
112    Without this permission SystemCallFilter=~@clock is set to
113    forfid call to clock.
114
115  - urn:AGL:permission::public:no-htdocs
116
117    The http directory served is not "htdocs" but "."
118
119  - urn:AGL:permission::public:applications:read
120
121    Allows to read data of installed applications (and to
122    access icons).
123
124  - urn:AGL:permission::partner:service:no-ws
125
126    Forbids services to provide its API through websocket.
127
128  - urn:AGL:permission::partner:service:no-dbus
129
130    Forbids services to provide its API through D-Bus.
131
132  - urn:AGL:permission::system:run-by-default
133
134    Starts automatically the application. Example: home-screen.
135
136  - http://tizen.org/privilege/internal/dbus
137
138    Permission to use D-Bus.
139
140
141 [URN]: https://tools.ietf.org/rfc/rfc2141.txt "RFC 2141: URN Syntax"
142