[Zope-PTK] ptk/zope newbie question- please read

Paul Erickson erickson@kaivo.com
Fri, 30 Jun 2000 09:18:24 -0600


This is a multi-part message in MIME format.
--------------A49123D53211CAD5FC355394
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Oops - did a reply instead of reply all

Paul Erickson wrote:

> I'm not real up to date on the PTK stuff... Hoping the LoginManager stuff settles
> down a bit, but I'll try to answer some questions.
>
> Sean Kelley wrote:
>
> > 1)
> > When I try to delete test members by deleting
> > them from the MEMBERS folder, I get the error that their
> > index_html file cannot be deleted (it also takes a VERY long time
> > after I hit the DELETE key and the index_html is listed in each
> > member's folder):
> > Error is...
> >
> > Error Type: ValueError
> > Error Value: Uncatalog of absent id
> > '/IntraPort/Members/membername/index_html'
> >  This seems to happen only on some users- not all
> >
>
> It sounds like the index_html object is getting put into a ZCatalog (ie; you're user
> objects (ZODBMember??) are catalog aware.  When a catalog aware object is deleted,
> it tries to remove itself from it's catalog.  If it is not in the catalog, then
> there is an error.  When this type of error happened to me, I had to reload the
> catalog thru the management interface, including all objects that should have been
> there in the first place.  After the catalog was loaded, then delete's worked just
> fine.
>
> The confusing thing is how you would get into that state.  It happened to me when I
> created some objects, then made the class catalog aware, which left the original
> objects out of the catalog.
>
> >
> > 2)
> > Where/how do you make it so that all new members are
> > automatically given contributor rights? (I don't want to have to
> > publish everyone's stuff in small company intranet)
> >
> > In general, I am trying to provide enough security so that nobody
> > but members can see the site.
> >
> > I could take a few approaches-
> > a) I could make it so that visitors can have enough rights to join,
> > but not to see any data.
> > b) I could make it so that nobody can even see the index_html
> > screen unless they are members (which means I would have to
> > create their user account myself before they can access) This is
> > starting to look like the easiest method, because then I can give
> > them contributor rights.
> >
> > Any suggestions?
>
> It's a hack, but you could modify the register method in PortalObject.py, changing
> this line:
>    self.addMember(username, password, ['Member'], [])
> to
>   self.addMember(username, password, ['Member', 'Contributor'], [])
>
> As a side note, it would be nice if the register method took a role list as a
> parameter for cases like this.  Someone else was asking about doing a "Buyer" and
> "Seller" registration, which could also use this.  Maybe there's a way to do this
> after the user has been created (in the register_hook method?)
>
> >
> >
> > 3)
> > Thanks for the members index_html fix (from another's posted fix to the
> > members page links to member index_html).  I too, would like to know how to
> > fix the listing of members that persist after they have been deleted.  It
> > seems to be an intermittent problem.
> >
> > Also, I noticed that the default manager user does not have an
> > index_html, so after the above fix, it does not work anyway for this
> > user.  I tried creating an index_html file for the manager, but this
> > did not work.
> >
>
> Sorry, don't know about this one.
>
> -Paul
>
> --
> Paul Erickson       | erickson@kaivo.com
> Kaivo, Inc.         | www.kaivo.com

--------------A49123D53211CAD5FC355394
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

X-Mozilla-Status2: 00000000
Message-ID: <395CB6E5.4DA51ABA@kaivo.com>
Date: Fri, 30 Jun 2000 09:04:05 -0600
From: Paul Erickson <erickson@kaivo.com>
Organization: Kaivo
X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: sean@promptsoftware.com
Subject: Re: [Zope-PTK] ptk/zope newbie question- please read
References: <000901bfe222$70497150$28eaa0a7@prompt1.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I'm not real up to date on the PTK stuff... Hoping the LoginManager stuff settles
down a bit, but I'll try to answer some questions.


Sean Kelley wrote:

> 1)
> When I try to delete test members by deleting
> them from the MEMBERS folder, I get the error that their
> index_html file cannot be deleted (it also takes a VERY long time
> after I hit the DELETE key and the index_html is listed in each
> member's folder):
> Error is...
>
> Error Type: ValueError
> Error Value: Uncatalog of absent id
> '/IntraPort/Members/membername/index_html'
>  This seems to happen only on some users- not all
>

It sounds like the index_html object is getting put into a ZCatalog (ie; you're user
objects (ZODBMember??) are catalog aware.  When a catalog aware object is deleted,
it tries to remove itself from it's catalog.  If it is not in the catalog, then
there is an error.  When this type of error happened to me, I had to reload the
catalog thru the management interface, including all objects that should have been
there in the first place.  After the catalog was loaded, then delete's worked just
fine.

The confusing thing is how you would get into that state.  It happened to me when I
created some objects, then made the class catalog aware, which left the original
objects out of the catalog.

>
> 2)
> Where/how do you make it so that all new members are
> automatically given contributor rights? (I don't want to have to
> publish everyone's stuff in small company intranet)
>
> In general, I am trying to provide enough security so that nobody
> but members can see the site.
>
> I could take a few approaches-
> a) I could make it so that visitors can have enough rights to join,
> but not to see any data.
> b) I could make it so that nobody can even see the index_html
> screen unless they are members (which means I would have to
> create their user account myself before they can access) This is
> starting to look like the easiest method, because then I can give
> them contributor rights.
>
> Any suggestions?

It's a hack, but you could modify the register method in PortalObject.py, changing
this line:
   self.addMember(username, password, ['Member'], [])
to
  self.addMember(username, password, ['Member', 'Contributor'], [])

As a side note, it would be nice if the register method took a role list as a
parameter for cases like this.  Someone else was asking about doing a "Buyer" and
"Seller" registration, which could also use this.  Maybe there's a way to do this
after the user has been created (in the register_hook method?)

>
>
> 3)
> Thanks for the members index_html fix (from another's posted fix to the
> members page links to member index_html).  I too, would like to know how to
> fix the listing of members that persist after they have been deleted.  It
> seems to be an intermittent problem.
>
> Also, I noticed that the default manager user does not have an
> index_html, so after the above fix, it does not work anyway for this
> user.  I tried creating an index_html file for the manager, but this
> did not work.
>

Sorry, don't know about this one.

-Paul

--
Paul Erickson       | erickson@kaivo.com
Kaivo, Inc.         | www.kaivo.com




--------------A49123D53211CAD5FC355394--