Class PermissionUtils

java.lang.Object
org.jenkinsci.plugins.vsphere.tools.PermissionUtils

public class PermissionUtils extends Object
Utility class for checking security permissions.
  • Method Details

    • throwUnlessUserHasPermissionToConfigureSlave

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToConfigureSlave(ItemGroup<?> context)
      Throws unless the user has permission to update this agent.
      Parameters:
      context - The @AncestorInPath ItemGroup that contains the agent.
      Throws:
      AccessDeniedException - if the user does not have permission.
    • throwUnlessUserHasPermissionToConfigureCloud

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToConfigureCloud(com.cloudbees.hudson.plugins.folder.AbstractFolder<?> folderContextOrNull)
      Throws unless the user has permission to update this cloud. For a cloud defined within a AbstractFolder, a user must have permission to configure the folder. For other (system global) clouds, the user must be an administrator.
      Parameters:
      folderContextOrNull - The @AncestorInPath AbstractFolder containing this cloud, or null if this is a global scope cloud.
      Throws:
      AccessDeniedException - if the user does not have permission.
    • throwUnlessUserHasPermissionToConfigureJob

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToConfigureJob(Item context)
      Throws unless the user has permission to update this job. This is used to police access to non-trivial build-step form validation and test methods that are only used when reconfiguring a job.
      Parameters:
      context - The @AncestorInPath Item of this job.
      Throws:
      AccessDeniedException - if the user does not have permission.
    • throwUnlessUserHasPermissionToAccessJob

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToAccessJob(Item context)
      Throws unless the user has permission to access this job. This is used to police access to non-trivial build-step form validation and test methods that could be useful when viewing or using a job.
      Parameters:
      context - The @AncestorInPath Item of this job.
      Throws:
      AccessDeniedException - if the user does not have permission.