Index: main/kernel/src/org/ametys/runtime/right/RightsManager.java
===================================================================
--- main/kernel/src/org/ametys/runtime/right/RightsManager.java	(revision 37284)
+++ main/kernel/src/org/ametys/runtime/right/RightsManager.java	(working copy)
@@ -83,6 +83,15 @@
     public Set<String> getGrantedUsers(String right, String context) throws RightsException;
     
     /**
+     * Get the list of users that have at least one right in a particular context.
+     * The implementations have to prefix the given context by the application rights' context prefix except if null.
+     * @param context The context to test the right.<br>May be null, in which case the returned Set contains all granted users, whatever the context.
+     * @return The list of users granted that have at least one right as a Set of String (login).
+     * @throws RightsException if an error occurs.
+     */
+    public Set<String> getGrantedUsers(String context) throws RightsException;
+    
+    /**
      * Get the list of a user's rights in a particular context.
      * The user's rights and the rights of the user's groups are returned.
      * The implementations have to prefix the given context by the application rights' context prefix except if null.
Index: main/plugin-core/src/org/ametys/runtime/plugins/core/right/BasicRightsManager.java
===================================================================
--- main/plugin-core/src/org/ametys/runtime/plugins/core/right/BasicRightsManager.java	(revision 37284)
+++ main/plugin-core/src/org/ametys/runtime/plugins/core/right/BasicRightsManager.java	(working copy)
@@ -47,6 +47,20 @@
         _rightsExtensionPoint = (RightsExtensionPoint) manager.lookup(RightsExtensionPoint.ROLE);
     }
     
+    @Override
+    public Set<String> getGrantedUsers(String context) throws RightsException
+    {
+        Set<String> usersLogin = new HashSet<String>();
+        
+        Collection<User> users = _users.getUsers();
+        for (User user : users)
+        {
+            usersLogin.add(user.getName());
+        }
+        
+        return usersLogin;
+    }
+
     public Set<String> getGrantedUsers(String right, String context) throws RightsException
     {
         Set<String> usersLogin = new HashSet<String>();
@@ -77,5 +91,4 @@
     {
         return RightsManager.RightResult.RIGHT_OK;
     }
-
 }
Index: main/plugin-core/src/org/ametys/runtime/plugins/core/right/profile/DefaultProfileBasedRightsManager.java
===================================================================
--- main/plugin-core/src/org/ametys/runtime/plugins/core/right/profile/DefaultProfileBasedRightsManager.java	(revision 37284)
+++ main/plugin-core/src/org/ametys/runtime/plugins/core/right/profile/DefaultProfileBasedRightsManager.java	(working copy)
@@ -296,6 +296,29 @@
     }
     
     @Override
+    public Set<String> getGrantedUsers(String context) throws RightsException
+    {
+        try
+        {
+            Set<String> users = new HashSet<String>();
+            
+            Set<String> convertedContexts = getAliasContext(context);
+            for (String convertContext : convertedContexts)
+            {
+                Set<String> addUsers = internalGetGrantedUsers(convertContext);
+                users.addAll(addUsers);
+            }
+            
+            return users;
+        }
+        catch (SQLException ex)
+        {
+            getLogger().error("Error in sql query", ex);
+            throw new RightsException("Error in sql query", ex);
+        }
+    }
+    
+    @Override
     public Set<String> getGrantedUsers(String right, String context) throws RightsException
     {
         try
@@ -319,6 +342,24 @@
     }
 
     /**
+     * Get the list of users that have at least one right on the given context.
+     * @param context The context to test the right.<br>May be null, in which case the returned Set contains all granted users, whatever the context.
+     * @return The list of users granted that have a least one right as a Set of String (login).
+     * @throws SQLException if an error occurs retrieving the rights from the database.
+     */
+    protected Set<String> internalGetGrantedUsers(String context) throws SQLException
+    {
+        String lcContext = getFullContext (context);
+
+        Set<String> logins = new HashSet<String>();
+        
+        logins.addAll(getGrantedUsersOnly(lcContext));
+        logins.addAll(getGrantedGroupsOnly(lcContext));
+        
+        return logins;
+    }
+    
+    /**
      * Get the list of users that have the given right on the given context.
      * @param right The name of the right to use. Cannot be null.
      * @param context The context to test the right.<br>May be null, in which case the returned Set contains all granted users, whatever the context.
@@ -1672,6 +1713,55 @@
         return mapContext2;
     }
 
+    private Set<String> getGrantedUsersOnly(String context) throws SQLException
+    {
+        Set<String> logins = new HashSet<String>();
+        
+        Connection connection = ConnectionHelper.getConnection(_poolName);
+        PreparedStatement stmt = null;
+        ResultSet rs = null;
+
+        try
+        {
+            // On regarde d'abord parmi les droits affectés directement aux
+            // utilisateurs
+            StringBuilder sql = new StringBuilder("SELECT DISTINCT UR.Login " + "FROM " + _tableProfileRights + " PR, " + _tableUserRights + " UR WHERE UR.Profile_Id = PR.Profile_Id ");
+
+            if (context != null)
+            {
+                sql.append("AND LOWER(UR.Context) ");
+                sql.append(_getCondition(context));
+                sql.append(" ?");
+            }
+
+            stmt = connection.prepareStatement(sql.toString());
+
+            if (context != null)
+            {
+                // LIKE query
+                stmt.setString(1, context.replace('*', '%'));
+            }
+
+            // Logger la requête
+            getLogger().info(sql.toString() + "\n[" + (context != null ? "," + context : "") + "]");
+
+            rs = stmt.executeQuery();
+
+            while (rs.next())
+            {
+                logins.add(rs.getString(1));
+            }
+
+            return logins;
+        }
+        finally
+        {
+            ConnectionHelper.cleanup(rs);
+            ConnectionHelper.cleanup(stmt);
+            ConnectionHelper.cleanup(connection);
+        }
+    }
+    
     private Set<String> getGrantedUsersOnly(String right, String context) throws SQLException
     {
         Set<String> logins = new HashSet<String>();
@@ -2047,6 +2137,68 @@
         }
     }
 
+    private Set<String> getGrantedGroupsOnly(String context) throws SQLException
+    {
+        Set<String> logins = new HashSet<String>();
+
+        Connection connection = ConnectionHelper.getConnection(_poolName);
+        PreparedStatement stmt = null;
+        ResultSet rs = null;
+
+        try
+        {
+            // Puis parmi les droits affectés aux groups auxquels appartient
+            // l'utilisateur
+            StringBuilder sql = new StringBuilder("SELECT DISTINCT GR.Group_Id " + "FROM " + _tableProfileRights + " PR, " + _tableGroupRights + " GR WHERE GR.Profile_Id = PR.Profile_Id ");
+
+            if (context != null)
+            {
+                sql.append("AND LOWER(GR.Context) ");
+                sql.append(_getCondition(context));
+                sql.append(" ?");
+            }
+
+            stmt = connection.prepareStatement(sql.toString());
+
+            if (context != null)
+            {
+                // LIKE query
+                stmt.setString(1, context.replace('*', '%'));
+            }
+
+            // Logger la requête
+            getLogger().info(sql.toString() + "\n[" + (context != null ? "," + context : "") + "]");
+
+            // boucle sur les group id retrouvés
+            rs = stmt.executeQuery();
+            while (rs.next())
+            {
+                String groupId = rs.getString(1);
+                
+                Group group = _groupsManager.getGroup(groupId);
+                if (group != null)
+                {
+                    for (String login : group.getUsers())
+                    {
+                        logins.add(login);
+                    }
+                }
+                else if (getLogger().isWarnEnabled())
+                {
+                    getLogger().warn("The group '" + groupId + "' is referenced in profile tables, but cannot be retrieve by GroupsManager. The database may be inconsistant.");
+                }
+            }
+
+            return logins;
+        }
+        finally
+        {
+            ConnectionHelper.cleanup(rs);
+            ConnectionHelper.cleanup(stmt);
+            ConnectionHelper.cleanup(connection);
+        }
+    }
+    
     private Set<String> getGrantedGroupsOnly(String right, String context) throws SQLException
     {
         Set<String> logins = new HashSet<String>();
@@ -3269,4 +3421,5 @@
             return _id.hashCode();
         }
     }
+
 }
Index: main/plugin-core/src/org/ametys/runtime/plugins/core/right/profile/HierarchicalProfileBasedRightsManager.java
===================================================================
--- main/plugin-core/src/org/ametys/runtime/plugins/core/right/profile/HierarchicalProfileBasedRightsManager.java	(revision 37284)
+++ main/plugin-core/src/org/ametys/runtime/plugins/core/right/profile/HierarchicalProfileBasedRightsManager.java	(working copy)
@@ -51,6 +51,43 @@
     }
     
     @Override
+    public Set<String> getGrantedUsers(String context) throws RightsException
+    {
+        try
+        {
+            if (context == null)
+            {
+                return super.getGrantedUsers(context);
+            }
+            else
+            {
+                Set<String> users = new HashSet<String>();
+    
+                Set<String> convertedContexts = getAliasContext(context);
+                for (String convertContext : convertedContexts)
+                {
+                    String transiantContext = convertContext;
+                    
+                    while (transiantContext != null)
+                    {
+                        Set<String> addUsers = internalGetGrantedUsers(transiantContext);
+                        users.addAll(addUsers);
+                        
+                        transiantContext = HierarchicalRightsHelper.getParentContext(transiantContext);
+                    }
+                }
+                
+                return users;
+            }
+        }
+        catch (SQLException ex)
+        {
+            getLogger().error("Error in sql query", ex);
+            throw new RightsException("Error in sql query", ex);
+        }
+    }
+    
+    @Override
     public Set<String> getGrantedUsers(String right, String context) throws RightsException
     {
         try
