Skip to content

Commit c792497

Browse files
Update src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetUserPermittedCollectionsCommand.java
Co-authored-by: Guillermo Portas <[email protected]>
1 parent 2e449f3 commit c792497

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetUserPermittedCollectionsCommand.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,25 @@
1313
import java.util.List;
1414
import java.util.logging.Logger;
1515

16-
@RequiredPermissions({}) // No specific permission is needed to execute this command. To filter the collection a list of permissions are passed in
16+
/**
17+
* Command that retrieves all {@link Dataverse} collections for which a given
18+
* {@link AuthenticatedUser} has the specified permission.
19+
* <p>
20+
* The permission is provided as a string corresponding to one of the names
21+
* in the {@link Permission} enumeration (e.g. {@code Permission.AddDataset.name()}).
22+
* If the special value {@code "any"} is passed, all collections for which
23+
* the user has at least one permission are returned.
24+
* </p>
25+
*
26+
* <p>
27+
* Example:
28+
* <pre>
29+
* new GetUserPermittedCollectionsCommand(request, user, Permission.AddDataset.name());
30+
* </pre>
31+
* will return the list of collections where the user can add datasets.
32+
* </p>
33+
*/
34+
@RequiredPermissions({})
1735
public class GetUserPermittedCollectionsCommand extends AbstractCommand<List<Dataverse>> {
1836
private static final Logger logger = Logger.getLogger(GetUserPermittedCollectionsCommand.class.getCanonicalName());
1937

0 commit comments

Comments
 (0)