View Javadoc

1   /* ------------------------------------
2    * � Kaamelot - 2006
3    * ------------------------------------
4    * Projet  : Myrddin
5    * Fichier : AdminProjectManager.java
6    */
7   package com.atlassian.jira.project;
8   
9   import java.util.Collection;
10  import java.util.Map;
11  
12  import org.ofbiz.core.entity.GenericValue;
13  
14  import com.atlassian.jira.exception.PermissionException;
15  import com.atlassian.plugin.web.Condition;
16  import com.opensymphony.user.DuplicateEntityException;
17  import com.opensymphony.user.EntityNotFoundException;
18  import com.opensymphony.user.User;
19  
20  /**------------------------------------
21   * � Kaamelot - 2006
22   * ------------------------------------
23   * @author Kaamelot
24   * Projet  : Myrddin
25   * Fichier : AdminProjectManager.java
26   * Description :
27   * This Interface defines methods providing informations concerning Users and Groups for the Project Administration  
28   */
29  public interface AdminProjectManager {
30  
31  	/**
32  	 * @return The FQCN of Condition to evaluate to use the current AdminProjectManager 
33  	 */
34  	public Condition getDefaultActivationCondition();
35  	
36  	/**
37  	 * @return The FQCN of Condition to evaluate to use the current AdminProjectManager 
38  	 */
39  	public String getDefaultActivationConditionFQCN();
40  	
41  	/**
42  	 * @param _project Concerned Project
43  	 * @param _user  Concerned User
44  	 * @return A list of Rule given the permission to administer the Project 
45  	 */
46  	public Collection getAuthorizingGroups(final GenericValue _project, final User _user);
47  
48  	/**
49  	 * @param _project Concerned Project
50  	 * @param _user  Concerned User
51  	 * @return A list of Rule given the permission to create User 
52  	 */
53  	public Collection getCreateUserAuthorizingGroups(final GenericValue _project, final User _user);
54  
55  	/**
56  	 * @return Map of Parameters required to identified Manageable Group 
57  	 */
58  	public Map getManageableGroupParameters();
59  	
60  	/**
61  	 * @param _project Concerned Project
62  	 * @param _params List of Parameters required to defined the list of Groups
63  	 * @return List of Groups identified as authorised to access the Project
64  	 */
65  	public Collection getAuthorizedGroups(final GenericValue _project, final Map _params);
66  
67  	/**
68  	 * @param _project Concerned Project
69  	 * @param _params List of Parameters required to defined the list of Groups
70  	 * @return List of Groups identified as authorised to Work on the Project
71  	 */
72  	public Collection getWorkableGroups(final GenericValue _project);
73  
74  	/**
75  	 * @param _project Concerned Project
76  	 * @param _params List of Parameters required to defined the list of Groups
77  	 * @return List of Groups identified in Project
78  	 */
79  	public Collection getManageableGroups(final GenericValue _project, final Map _params, final User _user);
80  
81  	/**
82  	 * Evaluate if the current user can Administer Group for its project
83  	 * @return True, if current has required Permission or Rule
84  	 * @throws Exception
85  	 */
86  	public boolean isHasManagerPermission(final Long _projectId, final User _user);
87  
88  	/**
89  	 * Evaluate if the current user can Administer Group for its project
90  	 * @param _project Concerned Project
91  	 * @param _user  Concerned User
92  	 * @return True, if current has required Permission or Rule
93  	 * @throws Exception
94  	 */
95  	public boolean isHasManagerPermission(final GenericValue _project, final User _user);
96  	
97  	/**
98  	 * @return The Filtering Group Name used for UserPicker to select User To Add
99  	 */
100 	public String getFilteringGroupName();
101 	
102 	public User addUserToGroup(final Long _projectId, final String _group, final String _user) throws EntityNotFoundException, PermissionException, DuplicateEntityException;
103 	
104 	public void removeUserFromGroup(final Long _projectId, final String _group, final String _user) throws EntityNotFoundException, PermissionException;
105 
106 	/**
107 	 * @param _projectId Project Id.
108 	 * @param _user
109 	 * @return
110 	 */
111 	public boolean isHasUserCreatePermission(Long _projectId, User _user);
112 
113 	/**
114 	 * @param _projectId Project Id.
115 	 * @param _userName User Name (Login)
116 	 * @param _fullName Full User Name
117 	 * @param _email email
118 	 */
119 	public User createUser(Long _projectId, String _userName, String _fullName, String _email) throws PermissionException;
120 }