Skip to content

Commit

Permalink
Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 30, 2025
1 parent 3397f39 commit 79c1280
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 546 deletions.
20 changes: 20 additions & 0 deletions core/src/main/java/jenkins/model/navigation/UserAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@
import static hudson.Functions.getAvatar;

import hudson.Extension;
import hudson.model.Action;
import hudson.model.RootAction;
import hudson.model.User;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
* TODO
*/
Expand Down Expand Up @@ -69,4 +75,18 @@ public String getUrlName() {
public User getUser() {
return User.current();
}

@Restricted(NoExternalUse.class)
public List<Action> getActions() {
User current = User.current();

if (User.current() == null) {
return null;
}

List<Action> actions = new ArrayList<>();
actions.addAll(current.getPropertyActions());
actions.addAll(current.getTransientActions());
return Collections.unmodifiableList(actions);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 79c1280

Please sign in to comment.