Back to index

plone3  3.1.7
canSelectDefaultPage.py
Go to the documentation of this file.
00001 ## Script (Python) "canSelectDefaultPage"
00002 ##title=Find out if a default page can be selected on this folderish item
00003 ##bind container=container
00004 ##bind context=context
00005 ##bind namespace=
00006 ##bind script=script
00007 ##bind subpath=traverse_subpath
00008 ##parameters=
00009 from AccessControl import Unauthorized
00010 
00011 # It's silly but because this is often called on the parent folder, we must
00012 # ensure we have permission.
00013 try:
00014     if not context.isPrincipiaFolderish:
00015         return False
00016 except Unauthorized:
00017         return False
00018 
00019 return context.canSetDefaultPage()