Move RBAC functionality into linux specific module and use it
[time-slider.git] / usr / share / time-slider / lib / time_slider / linux / rbac.py
1 #!/usr/bin/python2
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 import time_slider.rbac as base
24
25 class RBACprofile(base.RBACprofile):
26
27     def __init__(self, name = None):
28         base.RBACprofile.__init__(self, name)
29
30     def get_profiles(self):
31         # No real profile support yet
32         return []
33
34     def get_auths(self):
35         # No real auths support yet
36         return []
37
38     def has_profile(self, profile):
39         # root is all powerful
40         if self.uid == 0:
41             return True
42         else:
43             return False
44
45     def has_auth(self, auth):
46         # root is all powerful
47         if self.uid == 0:
48             return True
49         else:
50             return False
51
52 if __name__ == "__main__":
53   rbac = RBACprofile()
54   print rbac.name
55   print rbac.uid
56   print rbac.profiles
57   print rbac.auths
58