public class PermissionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
throwUnlessUserHasPermissionToAccessJob(Item context)
Throws unless the user has permission to access this job.
|
static void |
throwUnlessUserHasPermissionToConfigureCloud(com.cloudbees.hudson.plugins.folder.AbstractFolder<?> folderContextOrNull)
Throws unless the user has permission to update this cloud.
|
static void |
throwUnlessUserHasPermissionToConfigureJob(Item context)
Throws unless the user has permission to update this job.
|
static void |
throwUnlessUserHasPermissionToConfigureSlave(ItemGroup<?> context)
Throws unless the user has permission to update this agent.
|
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToConfigureSlave(ItemGroup<?> context)
context
- The @AncestorInPath
ItemGroup
that
contains the agent.AccessDeniedException
- if the user does not have permission.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToConfigureCloud(com.cloudbees.hudson.plugins.folder.AbstractFolder<?> folderContextOrNull)
AbstractFolder
, a user must have permission to
configure the folder. For other (system global) clouds, the user must be
an administrator.folderContextOrNull
- The @AncestorInPath
AbstractFolder
containing this cloud, or null if this is a global scope
cloud.AccessDeniedException
- if the user does not have permission.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToConfigureJob(Item context)
context
- The @AncestorInPath
Item
of this job.AccessDeniedException
- if the user does not have permission.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void throwUnlessUserHasPermissionToAccessJob(Item context)
context
- The @AncestorInPath
Item
of this job.AccessDeniedException
- if the user does not have permission.Copyright © 2016–2022. All rights reserved.