newbie is designing user, group and roles in Kotti

27 views
Skip to first unread message

Blaxton

unread,
Nov 18, 2018, 12:35:16 PM11/18/18
to ko...@googlegroups.com
following kotti user manual document:
https://kotti-user-manual.readthedocs.io/en/latest/introduction/users_and_roles.html


1- created 3 users.
2- created 3 groups and added each user to respected group:
Joe to prospects group, Sally to existing_clients group, and Xavier for the legal_affairs group.
3- created 3 top level section:
Prospects section, ExistingClients section, and Legal Affairs section
4- shared each section with respected group:
shared Prospects section with  prospects group, ....

5- tried to login with joe user id, but couldn't.
loging pages goes to try with no time out.

6- had to share "kotti home page" with "prospects group" to give view permission to be able to login as joe
but then joe can see all other sections.

apparently we have to share "Kotti Home Page" with user or group to be able to login
and that gives a global view to group.


What I want is:

members of prospect group, like joe, only able to view prospect section
and not other sections.

is it doable ? if yes , how ?

Andreas Kaiser

unread,
Nov 19, 2018, 3:21:45 AM11/19/18
to 'Blaxton' via Kotti

On 18 Nov 2018, at 18:31, 'Blaxton' via Kotti wrote:

following kotti user manual document:
https://kotti-user-manual.readthedocs.io/en/latest/introduction/users_and_roles.html


1- created 3 users.
2- created 3 groups and added each user to respected group:
Joe to prospects group, Sally to existing_clients group, and Xavier for the legal_affairs group.
3- created 3 top level section:
Prospects section, ExistingClients section, and Legal Affairs section
4- shared each section with respected group:
shared Prospects section with  prospects group, ....

5- tried to login with joe user id, but couldn't.
loging pages goes to try with no time out.

6- had to share "kotti home page" with "prospects group" to give view permission to be able to login as joe
but then joe can see all other sections.

apparently we have to share "Kotti Home Page" with user or group to be able to loginand that gives a global view to group.



What I want is:

members of prospect group, like joe, only able to view prospect section
and not other sections.

is it doable ? if yes , how ?

Everything is doable. Literally. In fact Kotti's workflow system is as flexible as it gets and probably one of its best features.

Did you find https://kotti.readthedocs.io/en/latest/developing/basic/security.html yet?

What you might want to do to achieve the above is to publish "Kotti Home Page" (transition it from state private to public). With the default workflow it will then be "visible" to all users (even unauthenticated) and doesn't need to be shared. The (default) role to permission(s) mapping for each state can be found in workflow.zcml.

You can completely customize all of this in your own workflow.zcml and make Kotti use that (instead of its default) by specifying kotti.use_workflow in your .ini.

HTH,
Andreas

Blaxton

unread,
Nov 19, 2018, 10:12:44 AM11/19/18
to 'Blaxton' via Kotti
Thank you.

I did change the "Kotti Home Page" to private after installation
and that was the cause of problem. changing it to public,
now Joe only sees , Kotti Home Page and Prospects section after login
and not able to see other sections.

I noticed the security document, but apparently new role needs to be added to
new add-on and I am stuck in creating new add-on following below document:



With Python2.7 , after installing Kotti, running "pserve app.ini" getting below errors:
    from kotti.resources import initialize_sql
  File "/full/path/to/virtualenv/mysite/lib/python2.7/site-packages/kotti/resources.py", line 102
    def __setitem__(self, key: str, node: 'Node') -> None:

Has python 2 support dropped ?

With Python 3, I can start Kotti running "pserve app.ini", but getting error
creating new add-on using scaffold:
pcreate -s kotti kotti_mysite
Unavailable scaffolds: kotti

I guess document needs to be updated to use cookiecutter if pcreate is not supported any more.

Thanks again for all your help.





--
You received this message because you are subscribed to the Google Groups "Kotti" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kotti+un...@googlegroups.com.
To post to this group, send email to ko...@googlegroups.com.
Visit this group at https://groups.google.com/group/kotti.
To view this discussion on the web visit https://groups.google.com/d/msgid/kotti/93B175E5-5877-46BC-A100-9DC6660A9BDE%40binary-punks.com.

For more options, visit https://groups.google.com/d/optout.

Andreas Kaiser

unread,
Nov 19, 2018, 10:39:09 AM11/19/18
to 'Blaxton' via Kotti
> Thank you.
> I did change the "Kotti Home Page" to private after installationand
> that was the cause of problem. changing it to public,now Joe only sees
> , Kotti Home Page and Prospects section after loginand not able to see
> other sections.
>
> I noticed the security document, but apparently new role needs to be
> added to
> new add-on and I am stuck in creating new add-on following below
> document:https://kotti.readthedocs.io/en/latest/first_steps/installation.html
>
>
> With Python2.7 , after installing Kotti, running "pserve app.ini"
> getting below errors:    from kotti.resources import initialize_sql
>   File
> "/full/path/to/virtualenv/mysite/lib/python2.7/site-packages/kotti/resources.py",
> line 102
>     def __setitem__(self, key: str, node: 'Node') -> None:
>
> Has python 2 support dropped ?

Yes. The only real difference between 1.3.2 and 2.0.0 is that the
former is Python 2 only and the latter is Python 3 only. Given that we
were kind of late in the game, we made no efforts to have Python 2 and 3
compatibility in the same version.

> With Python 3, I can start Kotti running "pserve app.ini", but getting
> errorcreating new add-on using scaffold:pcreate -s kotti kotti_mysite
> Unavailable scaffolds: kotti
>
> I guess document needs to be updated to use cookiecutter if pcreate is
> not supported any more.

It has been updated, but is currently only visible on the master branch
of the docs:
https://kotti.readthedocs.io/en/master/first_steps/tut-1.html

About time to release 2.0.0 final, I guess… :)


HTH,
Andreas

Blaxton

unread,
Nov 21, 2018, 4:39:38 PM11/21/18
to 'Blaxton' via Kotti
You are not later than me in the game, for sure :)

no point in starting with Python 2 if Kotti works with Python 3.
I was just trying to figure if document works with Python 2
since Python 3 was failing in pcreate and scaffolding .

followed master branch of Kotti document and completed the add-on documentation with no problem,
going to work on security and adding role and changing workflow, however
I can't find document for:

1- Enabling user self registration document !!!!
Do I need to install an add on to enable user self registration ?
or self registration comes with default Kotti installation.

2- Adding a new table to have user address, user billing, or other user profiles items,
that points back to principals table with foreign key. such table should be filled
when at the time of user registration.
Having a document or an add-on to add user profile for billing purpose real helps
in project startup.

Thanks for help


--
You received this message because you are subscribed to the Google Groups "Kotti" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kotti+unsub...@googlegroups.com.

To post to this group, send email to ko...@googlegroups.com.
Visit this group at https://groups.google.com/group/kotti.

davide moro

unread,
Nov 22, 2018, 2:59:33 AM11/22/18
to ko...@googlegroups.com
Hi Blaxton,

you can use the brand new Kotti scaffolding tool based on cookiecutter that supports python3:


Cheers, 

davide

To unsubscribe from this group and stop receiving emails from it, send an email to kotti+un...@googlegroups.com.

To post to this group, send email to ko...@googlegroups.com.
Visit this group at https://groups.google.com/group/kotti.

Andreas Kaiser

unread,
Nov 22, 2018, 3:35:36 AM11/22/18
to 'Blaxton' via Kotti

On 21 Nov 2018, at 22:39, 'Blaxton' via Kotti wrote:

1- Enabling user self registration document !!!!Do I need to install an add on to enable user self registration ?or self registration comes with default Kotti installation.

You can set kotti.register to True in your .ini file to enable user self registration. You can also set kotti.register.group and/or kotti.register.role to automatically assign group(s) or global role(s) to users upon their registration.

2- Adding a new table to have user address, user billing, or other user profiles items,
that points back to principals table with foreign key.

You could subclass kotti.security.Principal to add the desired attributes. Make sure to also add id = Column(ForeignKey(Principal.id), primary_key=True) for the foreign key. Then also subclass kotti.security.Principals and override the factory class attribute to point to your Principal subclass. The last step needed would be to set kotti.principals_factory (also in your .ini file) to point to your Principals subclass.

such table should be filledwhen at the time of user registration.

You'd still need to implement the views/forms to allow editing of your attributes yourself though.

Having a document or an add-on to add user profile for billing purpose real helpsin project startup.

You're welcome to add a section on that topic to the docs! ;-)

HTH,
Andreas

To unsubscribe from this group and stop receiving emails from it, send an email to kotti+un...@googlegroups.com.


To post to this group, send email to ko...@googlegroups.com.
Visit this group at https://groups.google.com/group/kotti.
To view this discussion on the web visit https://groups.google.com/d/msgid/kotti/1E9BADEF-B31C-4F40-841A-C275F89CEDBD%40binary-punks.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Kotti" group.

To unsubscribe from this group and stop receiving emails from it, send an email to kotti+un...@googlegroups.com.


To post to this group, send email to ko...@googlegroups.com.
Visit this group at https://groups.google.com/group/kotti.

Blaxton

unread,
Dec 5, 2018, 2:33:06 AM12/5/18
to 'Blaxton' via Kotti
Thank you Andreas for all your help.


Reply all
Reply to author
Forward
0 new messages