プロジェクト

全般

プロフィール

Vote #63909

未完了

Automatically add user to project

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Projects_11
対象バージョン:
-
開始日:
2008/09/25
期日:
進捗率:

0%

予定工数:
category_id:
11
version_id:
0
issue_org_id:
1945
author_id:
851
assigned_to_id:
0
comments:
11
status_id:
1
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

The process of manually adding users to projects can be troublesome sometimes so I wanted to suggest a feature. If a registered user submits a ticket for a particular project then they are automatically added as a member of the project. To handle role access you should be able to specify the default role they would be added as, for example reporter.


journals

I second this one. A setting to set what projects are allowed to auto add users would be handy in this case.
--------------------------------------------------------------------------------
+1

We have a policy of "all projects private", because we have open the forge for our customers also, but we would like to add automatically some projects for the Members authenticated via LDAP, instead of doing manually.

--------------------------------------------------------------------------------
Is this one still open?
--------------------------------------------------------------------------------
I am also curious.

The use case for me is that all projects are private by default (client-based) but we have a few key people that are part of every project so they should be automatically added to everyone.

Also, it would be a nice option to specify an admin user who is part of every project just for the ability to manage tickets in arbitrary projects.
--------------------------------------------------------------------------------
I have the same requirement. Here is the use case for us:

We allow issue creation from email in private projects to user that don't exist in redmine yet.
Mailhandler creates the user and emails him the details to login, but he needs to be manually added to the project to be able to see/update the ticket he's created.

Having the ability to automatically add the newly created user account to the project where he submited the issue (with an arbitrary role) would save us heaps of time.
--------------------------------------------------------------------------------
ok, here is a how I hacked it.
Obviously a proper option in the one of the Admin sections would be much better.
Or even having the above to set a default and then allow overriding for issues creation by email.

Note: I tested it only with redmine 1.4.2

<pre><code class="diff">
--- a/app/models/mail_handler.rb 2012-06-06 00:52:03.078284808 +0200
+++ b/app/models/mail_handler.rb 2012-06-06 01:16:04.897929499 +0200
@@ -402,6 +402,11 @@
if addr && !addr.spec.blank?
user = self.class.new_user_from_attributes(addr.spec, TMail::Unquoter.unquote_and_convert_to(addr.name, 'utf-8'))
if user.save
+ member = Member.new
+ member.user = user
+ member.project = Project.find_by_identifier(get_keyword(:project))
+ member.roles = [Role.find_by_name('Reporter')]
+ member.save
user
else
logger.error "MailHandler: failed to create User: #{user.errors.full_messages}" if logger
</code></pre>
--------------------------------------------------------------------------------
I had the same issue, tried a somewhat cleaner approach, i added a hook to user creation (by external authentifier), and created a small plugin using this hook.

patch: https://github.com/tshirtman/redmine/commit/790f57d61b379b2966d6f735e00c6e37b96f3eb8

plugin: https://github.com/tshirtman/redmine_new_user_actions

It would be great to have such a hook in Redmine merged. If the hook name I chosen is incorrect, use another one, if i forgot places to add it, i can fix it, just ask, but i would really like something like this to be merged, to have a more future-proof solution.
--------------------------------------------------------------------------------
That nasty hack from Nicolas also works perfect with 2.2.3
Apply that change starting on 457.
--------------------------------------------------------------------------------
The patch from Pettier's comment 7 is no longer available. I was able to implement a similar feature in v2.2.3 with the following changes:

In app/models/user.rb, insert at L185:
<pre><code class="ruby">Redmine::Hook.call_hook(:model_user_after_create_success, :user => user)</code></pre>

From your plugin's init.rb, include something like the following:
<pre><code class="ruby">
module RedmineNewUserHook
class Hooks < Redmine::Hook::Listener
def model_user_after_create_success(context={})
[here, do stuff like add user to default projects, etc.]
end
end
end
</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
this is handy and very usefull feature.

--------------------------------------------------------------------------------


related_issues

relates,New,2722,New user notification

Admin Redmine さんが約4年前に更新

  • カテゴリProjects_11 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0