Class PermissionUtils
java.lang.Object
org.jenkinsci.plugins.vsphere.tools.PermissionUtils
Utility class for checking security permissions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidThrows unless the user has permission to access this job.static voidthrowUnlessUserHasPermissionToConfigureCloud(com.cloudbees.hudson.plugins.folder.AbstractFolder<?> folderContextOrNull) Throws unless the user has permission to update this cloud.static voidThrows unless the user has permission to update this job.static voidThrows unless the user has permission to update this agent.
-
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@AncestorInPathItemGroupthat 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 aAbstractFolder, a user must have permission to configure the folder. For other (system global) clouds, the user must be an administrator.- Parameters:
folderContextOrNull- The@AncestorInPathAbstractFoldercontaining 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@AncestorInPathItemof 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@AncestorInPathItemof this job.- Throws:
AccessDeniedException- if the user does not have permission.
-