@@ -27,19 +27,33 @@ abstract final class Superuser {
2727 const Superuser ._();
2828
2929 /// Determine this program is executed by a user, who is superuser exactly or
30- /// one of members in superuser group.
30+ /// one of members in superuser group that it is possible to toggle [isActivated]
31+ /// (it can be executed with restricted permission that making [isActivated] retains
32+ /// false).
33+ ///
34+ /// For UNIX platform, it returns true if user who execute this program is `root`
35+ /// or a member of built-in group that can uses `sudo` command. (`admin` for macOS
36+ /// or `sudo` for majority of Linux systems).
37+ ///
38+ /// In Windows, it returns true if current user is a member of `Administrators`
39+ /// group in local machine. This detection does not consider Active Directory
40+ /// users.
3141 static bool get isSuperuser => instance.isSuperuser;
3242
33- /// Determine this program is running with superuser role.
43+ /// Determine this program is running with superuser role that it can
44+ /// access and modify protected location programmatically.
3445 ///
35- /// If this getter called in UNIX platforms (macOS or Linux),
36- /// it is an alias getter of [isSuperuser] since `root` is one and only
37- /// user can be represented as superuser.
46+ /// UNIX platforms (macOS and Linux) only consider executor is `root` ,
47+ /// whatever how this program called.
3848 ///
3949 /// For Windows platform, it consider this process has been elevated
40- /// or not.
50+ /// or not, which should be positive if and only if user granted UAC
51+ /// prompt.
4152 static bool get isActivated => instance.isActivated;
4253
4354 /// Obtain username who call current program.
4455 static String get whoAmI => instance.whoAmI;
56+
57+ /// Obtain user's associated groups in local system.
58+ static Iterable <String > get groups => instance.groups;
4559}
0 commit comments