X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddSiteTag.py;h=bb5cfaeb35c087da5c975f3abd101b8e3ba4fa20;hb=72f34552c9d6f81c6f0789ff03b07f2e7c34efa0;hp=20696982f87d9841da4b7ded03472ae085f5b803;hpb=e807caf3a73d84951a2fbfb09bae0b6a1eb4a942;p=plcapi.git diff --git a/PLC/Methods/AddSiteTag.py b/PLC/Methods/AddSiteTag.py index 2069698..bb5cfae 100644 --- a/PLC/Methods/AddSiteTag.py +++ b/PLC/Methods/AddSiteTag.py @@ -11,6 +11,7 @@ from PLC.Nodes import Nodes from PLC.TagTypes import TagType, TagTypes from PLC.SiteTags import SiteTag, SiteTags +# need to import so the core classes get decorated with caller_may_write_tag from PLC.AuthorizeHelpers import AuthorizeHelpers class AddSiteTag(Method): @@ -60,14 +61,7 @@ class AddSiteTag(Method): tag_type['tag_type_id']) # 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.person_in_site (self.api, self.caller, site): - pass - else: - raise PLCPermissionDenied, "%s: you must be part of the subject site"%self.name + site.caller_may_write_tag(self.api,self.caller,tag_type) site_tag = SiteTag(self.api) site_tag['site_id'] = site['site_id']