I'm trying to retrieve a list of groups from LDAP using django-auth-ldap. It is already authenticating against the LDAP but now I need to retrieve the groups available so I can use them in one of my Models.
One of my models has a group attr that will map to LDAP groups, I want to retrieve those groups to populate a combo so the user can pick one.
Related
I need to create groups on a server instance from its frontend. I need to do the following:
Login to the server
Check if the requested group already exists.
If it doesnot, then create a new group. For this I need to fill a form. group name will be provided by the requestor, the rest of the things will be selected from drop-down menu and all of them have a default value.
All this has to be done using python. I know how to connect to a server frontend. but i am not sure about checking the existence of the group name and how to select options from a drop-down
Use a database and store group names and when a user want to create a new group take the group and query the database if a group with that name already exist if yes send a message to the user that the group already exist else add new group and continue with other options,I don't know if this is what you want
I'm new to Django and I'm trying to figure out which path to take to solve a problem.
Many-to-one OR Django Groups?
I have a cat model and now I want to associate any new cats entered into my app with cat litters. (think new kittens)
I've been reading about Django Groups but only see this associated with the User model. Can Django Groups be used for any models I create? Is that the best path to get to what I want or should I just rely on a regular Many-to-One model relationship and build out regular models that way?
Groups: A generic way of applying labels and permissions to more than one user.
In your case I would use,
one to many: assuming each kitten belongs to one cat.
many to many: if you link kitten to utmost two cats.
You should use groups for user authentication things, like admin group or specific user group and assign permission or rights to specific groups.
So use accordingly.
more info on user authentication and groups
I have read about adding custom attributes to our domain schema. Is there any way to base group membership on this custom schema data? i.e. have a user be added to a group automatically if they have a certain custom attribute flag, or any particular schema data for that matter, similar to the way you can add all users of a domain to a group. I guess it would be the same or similar to dynamic groups in LDAP.
I have a Django app that uses the stock User and Group models. I have two groups, group A and group B. I would like to prevent any user from being in both group A and group B, being in just one group or the other is fine. what is the best way to go about this? I was looking into model validation but I would like to do this without modifying or sub classing the stock User model. It would even be enough for me to be able to check and make sure that this wasnt being set on the django admin edit user page.
I want to use the Django default auth system to manage users and groups. Is there an existing Django app/module that adds users to groups by invites? I.e. some existing user of the group sends an invite with a secret key in a URL, and another user that clicks on the URL joins the group.
I can write one, but figured I ask before doing that.
Thanks.
I am not sure if this will solve all your problems but do take a look at Pinax. They have features to support user invitation and user groups.