Hi,

We get the following permissions error when attempting to set the id
of our custom remember.content.member.Member subclass either by using
an event subscriber, abusing the Archetypes validation hooks or
setting _at_rename_after_creation=True and overriding generateNewId:

2008-06-03T18:08:38 ERROR Zope.SiteErrorLog
http://localhost:8080/durban/portal_memberdata/portal_factory/eThekwiniMember/ethekwinimember.2008-06-03.1147579855/reg_form
Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Products.CMFPlone.FactoryTool, line 369, in __call__
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Products.CMFFormController.FSControllerPageTemplate, line 90,
in __call__
  Module Products.CMFFormController.BaseControllerPageTemplate, line
28, in _call
  Module Products.CMFFormController.ControllerBase, line 232, in
getNext
   - __traceback_info__: ['id = reg_form', 'status = success',
'button=register', 'errors={}', 'context=<eThekwiniMember at
ethekwinimember.2008-06-03.1147579855>',
"kwargs={'portal_status_message': 'Changes saved.'}",
'next_action=None', '']
  Module Products.CMFFormController.Actions.TraverseTo, line 38, in
__call__
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module Products.CMFFormController.FSControllerPythonScript, line
104, in __call__
  Module Products.CMFFormController.Script, line 145, in __call__
  Module Products.CMFCore.FSPythonScript, line 108, in __call__
  Module Shared.DC.Scripts.Bindings, line 311, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Products.CMFCore.FSPythonScript, line 164, in _exec
  Module None, line 5, in do_register
   - <FSControllerPythonScript at /durban/do_register used for /durban/
portal_memberdata/portal_factory/eThekwiniMember/ethekwinimember.
2008-06-03.1147579855>
   - Line 5
  Module Products.Archetypes.BaseObject, line 649, in processForm
  Module Products.Archetypes.BaseObject, line 752, in
_renameAfterCreation
  Module Products.remember.content.member, line 100, in setId
  Module Products.Archetypes.BaseObject, line 236, in setId
  Module OFS.CopySupport, line 344, in manage_renameObject
Copy Error:
<HTML>
<HEAD>
<TITLE>Not Supported</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<FORM ACTION="manage_main" METHOD="GET" >
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="10">
<TR>
  <TD VALIGN="TOP">
  <BR>
  <CENTER><B><FONT SIZE="+6" COLOR="#77003B">!</FONT></B></CENTER>
  </TD>
  <TD VALIGN="TOP">
  <BR><BR>
  <CENTER>
  The action against the <em>ethekwinimember.2008-06-03.1147579855</
em> object could not be carried out. One of the following constraints
caused the problem: <br><br>The object does not support this
operation.<br><br>-- OR --<br><br>The currently logged-in user does
not have the <b>Copy or Move</b> permission respective to the object.
  </CENTER>
  </TD>
</TR>
<TR>
  <TD VALIGN="TOP">
  </TD>
  <TD VALIGN="TOP">
  <CENTER>
  <INPUT TYPE="SUBMIT" VALUE="   Ok   ">
  </CENTER>
  </TD>
</TR>
</TABLE>
</FORM>
</BODY></HTML>

My analysis is that the Anonymous user doesn't have the 'Copy or Move'
permission on portal_membership- how can I change this?
I've already given the Anonymous user the following permissions:
Add portal member
Copy or Move
membrane: Edit member id
membrane: Register member
remember: Add FolderishMember

Any ideas?

I've had another idea around trying to implement this id change in the
approval workflow, anyone have some general approach tips?

thanks
michael

On May 13, 12:48 am, Rob Miller <[EMAIL PROTECTED]> wrote:
> HodrenNaidoo wrote:
> > I wanna create a new user profile but I want the username to be generated 
> > using the first name and second name. Is there a way this can be done?
>
> yes, it can be done, it may have a few tricky corners.  the id field of the
> member object is what is used as the username, by default, and id fields are a
> bit special; they're roughly the ZODB equivalent of a relational database's
> primary key.  you have to have an id, and once you set the id you shouldn't
> change it.
>
> i'd probably do something like this:
>
> - tweak the id widget's 'visible' settings so it no longer shows up on the
> edit forms (also make regfield=0 so it doesn't show up on join form).
>
> - create an IObjectAdded event subscriber that generates the id value and sets
> it on the member object.  probably want to check to make sure that the id is
> an auto-generated one, so you don't accidentally change the id should this
> event ever get fired when you don't expect it to.
>
> keep in mind that if you allow users to edit their first and last names,
> there's a possibility that the id and the names may become out of sync.
>
> -r
>
>   I was thinking of inserting an algorithm that runs once the register button
> has been clicked. Can this be done? Thanks in advance
>
>
>
> > --
> > Archive:http://www.openplans.org/projects/remember/lists/remember/archive/200...
> > To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
> > Please contact [EMAIL PROTECTED] for questions.
>
> --
> Archive:http://www.openplans.org/projects/remember/lists/remember/archive/200...
> To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
> Please contact [EMAIL PROTECTED] for questions.


--
Archive: 
http://www.openplans.org/projects/remember/lists/remember/archive/2008/06/1212752851883
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to