diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-04-02 17:44:06 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-04-02 17:44:06 -0400 |
commit | cb93964cf63ad7e56fd5d581df3b59c0e7e8d1ac (patch) | |
tree | a1babc4ae2f7564353911044434e6ce129756893 | |
parent | 511d6fc9976bd10344c920a4f03ba57da70527d9 (diff) | |
download | third_party-cobbler-cb93964cf63ad7e56fd5d581df3b59c0e7e8d1ac.tar.gz third_party-cobbler-cb93964cf63ad7e56fd5d581df3b59c0e7e8d1ac.tar.xz third_party-cobbler-cb93964cf63ad7e56fd5d581df3b59c0e7e8d1ac.zip |
Some fixes to the ownership module.
-rw-r--r-- | cobbler/modules/authz_ownership.py | 8 | ||||
-rw-r--r-- | cobbler/webui/CobblerWeb.py | 8 | ||||
-rw-r--r-- | webui_templates/distro_edit.tmpl | 1 | ||||
-rw-r--r-- | webui_templates/profile_edit.tmpl | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/cobbler/modules/authz_ownership.py b/cobbler/modules/authz_ownership.py index 9e7a217..1fe25a9 100644 --- a/cobbler/modules/authz_ownership.py +++ b/cobbler/modules/authz_ownership.py @@ -50,7 +50,7 @@ def __parse_config(): alldata[g][o] = 1 return alldata -def __authorize_kickstart(api_handle, user, user_groups, file): +def __authorize_kickstart(api_handle, user, user_groups, kickstart): # the authorization rules for kickstart editing are a bit # of a special case. Non-admin users can edit a kickstart # only if all objects that depend on that kickstart are @@ -142,8 +142,8 @@ def authorize(api_handle,user,resource,arg1=None,arg2=None): # kickstarts are even more special so we call those out to another # function, rather than going through the rest of the code here. - if resource.find("kickstart"): - return authorize_kickstart(api_handle,user,user_groups,arg1) + if resource.find("kickstart") != -1: + return __authorize_kickstart(api_handle,user,user_groups,arg1) obj = None if resource.find("remove") != -1: @@ -162,7 +162,7 @@ def authorize(api_handle,user,resource,arg1=None,arg2=None): if obj.owners is None or obj.owners == []: return 1 - return __is_user_allowed(user,group,user_groups) + return __is_user_allowed(obj,user,user_groups) if __name__ == "__main__": diff --git a/cobbler/webui/CobblerWeb.py b/cobbler/webui/CobblerWeb.py index f6afe2f..cdeef24 100644 --- a/cobbler/webui/CobblerWeb.py +++ b/cobbler/webui/CobblerWeb.py @@ -175,7 +175,7 @@ class CobblerWeb(object): def distro_save(self,name=None,oldname=None,new_or_edit=None,editmode='edit',kernel=None, initrd=None,kopts=None,ksmeta=None,owners=None,arch=None,breed=None, - delete1=None,delete2=None,**args): + delete1=None,delete2=None,recursive=False,**args): if not self.__xmlrpc_setup(): return self.xmlrpc_auth_failure() @@ -188,7 +188,7 @@ class CobblerWeb(object): # handle deletes as a special case if new_or_edit == 'edit' and delete1 and delete2: try: - self.remote.remove_distro(name,self.token,1) # recursive + self.remote.remove_distro(name,self.token,recursive) except Exception, e: return self.error_page("could not delete %s, %s" % (name,str(e))) return self.distro_list() @@ -460,7 +460,7 @@ class CobblerWeb(object): distro=None,kickstart=None,kopts=None, ksmeta=None,owners=None,virtfilesize=None,virtram=None,virttype=None, virtpath=None,repos=None,dhcptag=None,delete1=None,delete2=None, - parent=None,virtcpus=None,virtbridge=None,subprofile=None,server_override=None,**args): + parent=None,virtcpus=None,virtbridge=None,subprofile=None,server_override=None,recursive=False,**args): if not self.__xmlrpc_setup(): return self.xmlrpc_auth_failure() @@ -480,7 +480,7 @@ class CobblerWeb(object): # handle deletes as a special case if new_or_edit == 'edit' and delete1 and delete2: try: - self.remote.remove_profile(name,self.token,1) + self.remote.remove_profile(name,self.token,recursive) except Exception, e: return self.error_page("could not delete %s, %s" % (name,str(e))) return self.profile_list() diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl index 47b7e10..80536f5 100644 --- a/webui_templates/distro_edit.tmpl +++ b/webui_templates/distro_edit.tmpl @@ -203,6 +203,7 @@ function disablename(value) <td> <input type="checkbox" name="delete1" value="delete1">Yes <input type="checkbox" name="delete2" value="delete2">Really + <input type="checkbox" name="recursive" value="recursive">Delete child objects? <p class="context-tip">Check both buttons and click save to delete this object</p> </td> </tr> diff --git a/webui_templates/profile_edit.tmpl b/webui_templates/profile_edit.tmpl index 258a8f2..82be534 100644 --- a/webui_templates/profile_edit.tmpl +++ b/webui_templates/profile_edit.tmpl @@ -340,6 +340,7 @@ function disablename(value) <td> <input type="checkbox" name="delete1" value="delete1">Yes <input type="checkbox" name="delete2" value="delete2">Really + <input type="checkbox" name="recursive" value="recursive">Delete child objects? <p class="context-tip">Check both buttons and click save to delete this object</p> </td> </tr> |