Re: [Zope3-Users] configure access from zcml

2007-02-22 Thread Tim Terlegård
On Wed, Feb 21, 2007 at 11:04:26AM +0100, Michael Haubenwallner wrote:
 The publication requestfactories are available by default.
 Is there a way to configure protocol access to the whole site, local 
 sites, containers or objects through ZCML ?
 
 How would a sysadmin e.g. enable xmlrpc access to the site or a folder 
 only or disable xmlrpc access to a certain object or interface ?

I'm not completely sure, but perhaps you can override the traverse
zcml directives in zope/app/publisher/xmlrpc/configure.zcml

Tim
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] proxied list object in a schema

2006-12-19 Thread Tim Terlegård
On Sun, Dec 17, 2006 at 09:57:08PM +0100, FB wrote:
 On Sun, Dec 17, 2006 at 02:21:03PM +0100, Tim Terlegård wrote:
  Would someone like to explain how to use a list in a schema object
  without getting ForbiddenAttribute? This is my use case.
  
  class IChat(Interface):
  messages = Attribute('Chat messages')
  
  class Chat(Persistent):
  def __init__(self):
  self.messages = persistent.list.PersistentList()
 
 try that:
 
 class MyList(persistent.list.PersistentList):
pass
 
 class class=.MyList
...
 /class
 
 You should find the necessary interfaces for your requires in
 zope.interface.common.mapping.

This worked very well. I used ISequence from
zope.interface.common.sequence. The good part is that I now understand
why it should be done this way. Thanks.

Tim
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: proxied list object in a schema

2006-12-17 Thread Tim Terlegård
Hi Jürgen,

Actually Chat implements IChat, I forgot that line.

Are all attributes of an object proxied or are for instance attributes
starting with _ not proxied?

Tim


 Hi Tim,
 Chat must implement IChat
 
 Jürgen
 
 Tim Terlegård wrote:
 Would someone like to explain how to use a list in a schema object
 without getting ForbiddenAttribute? This is my use case.
 
 class IChat(Interface):
 messages = Attribute('Chat messages')
 
 class Chat(Persistent):
 def __init__(self):
 self.messages = persistent.list.PersistentList()
 
 class class=.chat.Chat
 require permission=zope.View interface=.interfaces.IChat /
 require permission=zope.View set_schema=.interfaces.IChat /
 /class
 
 I have a Chat class that implements IChat and that is declared in
 configure.zcml. Both the chat object and the 'messages' attribute are
 proxied automatically, right? The require / tags in configure.zcml
 adds security declarations to the chat object, but not to the 'messages'
 attribute. Am I correct this far?
 
 When I call self.context.messages.append(...) (in a browser page for
 IChat) I get ForbiddenAttribute on append. I should get this, so this
 is ok. But list or PersistentList has no interface I can use in IChat
 instead of Attribute. So I tried using zope.schema.List instead, but
 the interface of that was a small subset of what list provides and
 doesn't have append either. So I don't know how to add these security
 declarations to the 'messages' attribute.
 
 How can I use a list without getting security proxy problems? Do I have
 to make my own list implementation and interface?
 
 Tim
 
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] ForbiddenAttribute when adding to a folder

2006-10-21 Thread Tim Terlegård
Is there a way to add content without having @@+ in the URL? For
instance I'd like the url for adding events to be /addEvent.

I get security problems when not having @@+ in the URL. I have this view:

  browser:page
  for=zope.app.container.interfaces.IWriteContainer
  name=addEvent
  class=.eventforms.EventAddForm
  permission=zope.ManageContent
  /

When I hit the submit button in this add form I get an error:
ForbiddenAttribute: ('add', zope.app.folder.folder.Folder object at
0xb6e65d2c)

I realize IWriteContainer might not be the right interface, it doesn't
have any add method.

Should I have for=zope.app.container.interfaces.IAdding instead and
somehow add an adapter from IFolder to IAdding or how would I do this?

Tim
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users