Ignore:
Timestamp:
23.07.2010 23:00:24 (22 months ago)
Author:
zmsdev
Message:

Added support for access-nodes to actions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/zmsobject.py

    r1122 r1123  
    960960      actions = [] 
    961961      auth_user = REQUEST['AUTHENTICATED_USER'] 
     962      absolute_url = '/'.join(list(self.getPhysicalPath())+['']) 
    962963       
    963964      #-- Commands. 
     
    970971          hasRole = hasRole or len(self.intersection_list(self.getUserRoles(auth_user),metaCmd['roles'])) > 0 
    971972          hasRole = hasRole or auth_user.has_role('Manager') 
    972           if hasMetaType and hasRole: 
     973          nodes = self.string_list(metaCmd.get('nodes','{$}')) 
     974          sl = [] 
     975          sl.extend(map( lambda x: (self.getHome().id+'/content/'+x[2:-1]+'/').replace('//','/'),filter(lambda x: x.find('@')<0,nodes))) 
     976          sl.extend(map( lambda x: (x[2:-1].replace('@','/content/')+'/').replace('//','/'),filter(lambda x: x.find('@')>0,nodes))) 
     977          hasNode = len( filter( lambda x: absolute_url.find(x)>=0, sl)) > 0 
     978          if hasMetaType and hasRole and hasNode: 
    973979            actions.append((metaCmd['name'],path+'manage_executeMetacmd')) 
    974980       
Note: See TracChangeset for help on using the changeset viewer.