Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic Group Creation based on Username #75

Open
jedi-marcus opened this issue Dec 2, 2019 · 9 comments
Open

Automatic Group Creation based on Username #75

jedi-marcus opened this issue Dec 2, 2019 · 9 comments
Assignees
Milestone

Comments

@jedi-marcus
Copy link

We are preparing to migrate to the latest Nextcloud and will be using this plugin for User Authentification.

We are currently missing one crucial feature we programmed ourselves in the old system:

  • Automatic Group Creation based on Username

How did this look?
Upon automatic creation of user on first login, we would add the user to a group for this domain.
Example, User:
[email protected]
would be added to a group
Foobar/doe.com
Foobar is just a keyword we decided on to identify our platform.

Since we are hosting multiple, independent domains, this way the users of a single domain would all be grouped and see only users in their domain (e.g. to share with).

Initially we ( @dattn & I ) thought that Group Name Filter might be the answer, but based on the code, it doesn't look like it.

Possible solution would be 1-2 configs to match a regex on the username and then put the result of the regex into another expression.

Could you please:

  1. confirm that this is not a feature as of today
  2. tell us if you like the solution, we would handle the development and create the necessary pull request.
@felixrupp
Copy link
Owner

Hey @jedi-marcus

I can confirm, that this is not a feature as of today. If you are willing to develop this feature, feel free to do so! I am always happy to have some helping hands!

Regards and have a great christmas,

Felix

@felixrupp felixrupp added this to the 1.9 milestone Jan 28, 2020
@jedi-marcus
Copy link
Author

Good things might take longer, but I'm into this again.

I'm currently analyzing the normal "Group Creation" and I notice that this is only applied when the option "Update user data after each CAS login?" is enabled.

It took me some time to figure this out and don't know if it's the best solution. If we clean this up a little it might also solve #73 in the same run, no?

@felixrupp
Copy link
Owner

Hi @jedi-marcus

I think you mix up things there. The option "Update user data after each CAS login?" is to enable/disable the update of user data on login.

Group creation in the regular CAS login process is triggered as part of this user data update process. The current/old sourcecode for this is actually removing all groups from the user and adding them (and probably new ones) again. That’s what causes #73. Therefore I have to improve the process of updating the user’s groups, so the current groups do not get detached and reattached on login all the time.

If you decouple the group update/creation part from the "Update user data after each CAS login?" option, the user’s groups (coming from the CAS) are not synced to the ownCloud/Nextcloud group interface anylonger. That’s NOT what we want.

Regards,
Felix

@felixrupp
Copy link
Owner

@jedi-marcus Any update on this feature?

@jedi-marcus
Copy link
Author

I wasn't able to provide a version that would keep with your spirit and solve our issue, so we didn't commit anything yet.

@felixrupp
Copy link
Owner

@jedi-marcus Okay, i’ll try to find a solution, I currently have some time leftover.

@felixrupp
Copy link
Owner

/cib

@create-issue-branch
Copy link

@felixrupp
Copy link
Owner

Added with Version 1.9. Please review the function and close the ticket afterwards. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants