@@ -83,8 +83,8 @@ def __init__(self, userDN, userGroup, allInfo=True):
83
83
self .userProperties = getPropertiesForGroup (userGroup , [])
84
84
self .jobDB = None
85
85
self .allInfo = allInfo
86
- self .__permissions = {}
87
- self .__getUserJobPolicy ()
86
+ self ._permissions = {}
87
+ self ._getUserJobPolicy ()
88
88
89
89
def getUserRightsForJob (self , jobID , owner = None , group = None ):
90
90
"""Get access rights to job with jobID for the user specified by
@@ -102,44 +102,44 @@ def getUserRightsForJob(self, jobID, owner=None, group=None):
102
102
103
103
return self .getJobPolicy (owner , group )
104
104
105
- def __getUserJobPolicy (self ):
105
+ def _getUserJobPolicy (self ):
106
106
"""Get the job rights for the primary user for which the JobPolicy object
107
107
is created
108
108
"""
109
109
# Can not do anything by default
110
110
for right in ALL_RIGHTS :
111
- self .__permissions [right ] = False
111
+ self ._permissions [right ] = False
112
112
113
113
# Anybody can get info about the jobs
114
114
if self .allInfo :
115
- self .__permissions [RIGHT_GET_INFO ] = True
115
+ self ._permissions [RIGHT_GET_INFO ] = True
116
116
117
117
# Give JobAdmin permission if needed
118
118
if Properties .JOB_ADMINISTRATOR in self .userProperties :
119
119
for right in PROPERTY_RIGHTS [Properties .JOB_ADMINISTRATOR ]:
120
- self .__permissions [right ] = True
120
+ self ._permissions [right ] = True
121
121
122
122
# Give JobMonitor permission if needed
123
123
if Properties .JOB_MONITOR in self .userProperties :
124
124
for right in PROPERTY_RIGHTS [Properties .JOB_MONITOR ]:
125
- self .__permissions [right ] = True
125
+ self ._permissions [right ] = True
126
126
127
127
# Give normal user permission if needed
128
128
if Properties .NORMAL_USER in self .userProperties :
129
129
for right in PROPERTY_RIGHTS [Properties .NORMAL_USER ]:
130
- self .__permissions [right ] = True
130
+ self ._permissions [right ] = True
131
131
132
132
# Give permissions of the generic pilot
133
133
if Properties .GENERIC_PILOT in self .userProperties :
134
134
for right in PROPERTY_RIGHTS [Properties .GENERIC_PILOT ]:
135
- self .__permissions [right ] = True
135
+ self ._permissions [right ] = True
136
136
137
137
def getJobPolicy (self , jobOwner = "" , jobOwnerGroup = "" ):
138
138
"""Get the job operations rights for a job owned by jobOwnerDN/jobOwnerGroup
139
139
for a user with userDN/userGroup.
140
140
Returns a dictionary of various operations rights
141
141
"""
142
- permDict = dict (self .__permissions )
142
+ permDict = dict (self ._permissions )
143
143
# Job Owner can do everything with his jobs
144
144
if jobOwner and self .userName and jobOwner == self .userName :
145
145
for right in OWNER_RIGHTS :
0 commit comments