X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FDeleteInterfaceTag.py;h=5ef9635fa9654f8b9e3a0cfbe90e9aaf251986b7;hb=36de11f1c6e35ae81eb4774a395f3507cd44feb3;hp=b1672a7023f8dba30a2063288dfd075b8b428d12;hpb=d0c553e8b3a7191514d56cb312552f325c67db90;p=plcapi.git diff --git a/PLC/Methods/DeleteInterfaceTag.py b/PLC/Methods/DeleteInterfaceTag.py index b1672a7..5ef9635 100644 --- a/PLC/Methods/DeleteInterfaceTag.py +++ b/PLC/Methods/DeleteInterfaceTag.py @@ -12,6 +12,9 @@ from PLC.Interfaces import Interface, Interfaces from PLC.TagTypes import TagType, TagTypes from PLC.InterfaceTags import InterfaceTag, InterfaceTags +# need to import so the core classes get decorated with caller_may_write_tag +from PLC.AuthorizeHelpers import AuthorizeHelpers + class DeleteInterfaceTag(Method): """ Deletes the specified interface setting @@ -47,14 +50,7 @@ class DeleteInterfaceTag(Method): interface=interfaces[0] # check authorizations - if 'admin' in self.caller['roles']: - pass - elif not AuthorizeHelpers.caller_may_access_tag_type (self.api, self.caller, tag_type): - raise PLCPermissionDenied, "%s, forbidden tag %s"%(self.name,tag_type['tagname']) - elif AuthorizeHelpers.interface_belongs_to_person (self.api, interface, self.caller): - pass - else: - raise PLCPermissionDenied, "%s: you must belong in the same site as subject interface"%self.name + interface.caller_may_write_tag(self.api,self.caller,tag_type) interface_tag.delete() self.object_ids = [interface_tag['interface_tag_id']]