These are chat archives for mirumee/saleor

15th
Apr 2019
Aavash Khatri
@Aavash
Apr 15 09:16
hey guys I am new to saleor and have a noob question. What are the default user types in saleor and how do I customize the types to add or remove them? I am going through the codebase for about a couple of days. Any help would be greatly appreciated.
NyanKiyoshi
@NyanKiyoshi
Apr 15 09:17
Hey! You mean like is_staff? Probably just by adding a new boolean field?
Aavash Khatri
@Aavash
Apr 15 09:17
No I need to add new user type like a merchant.
and assign certain crud permission to them
Is there something that saleor is provides us with out of the box or do I have to add those functionalities on my own?
NyanKiyoshi
@NyanKiyoshi
Apr 15 09:20
Ah! Then you would need to create a new model having a one-to-many relation to users, then you add permissions to the model in the meta class (example here https://github.com/mirumee/saleor/blob/f1196815925249009fc209a5ee6063aa7ac28275/saleor/product/models.py#L128-L131 ; then updating this : https://github.com/mirumee/saleor/blob/05661af5c4193145373a0b9e656a6d076ac72c47/saleor/core/permissions.py#L3-L14)
Aavash Khatri
@Aavash
Apr 15 09:21
Okay. Thanks a lot.
@NyanKiyoshi
NyanKiyoshi
@NyanKiyoshi
Apr 15 09:21
If you are new to django, I recommend you take a look around on the Internet how models and relations work :)
Aavash Khatri
@Aavash
Apr 15 09:22
okay. Thanks a lot.