/** * @deprecated since 1.277 * Override {@link #getACL(Job)} instead. */ @Deprecated public @Nonnull ACL getACL(@Nonnull AbstractProject<?,?> project) { return getACL((Job)project); }
/** * Servlet container can tie a {@link ServletRequest} to the request handling thread, * so we need to capture all the information upfront to allow {@link Authentication} * to be passed to other threads, like update center does. See HUDSON-5382. */ public ContainerAuthentication(HttpServletRequest request) { this.principal = request.getUserPrincipal(); if (principal==null) throw new IllegalStateException(); // for anonymous users, we just don't call SecurityContextHolder.getContext().setAuthentication. // Servlet API doesn't provide a way to list up all roles the current user // has, so we need to ask AuthorizationStrategy what roles it is going to check against. List<GrantedAuthority> l = new ArrayList<GrantedAuthority>(); for( String g : Jenkins.getInstance().getAuthorizationStrategy().getGroups()) { if(request.isUserInRole(g)) l.add(new GrantedAuthorityImpl(g)); } l.add(SecurityRealm.AUTHENTICATED_AUTHORITY); authorities = l.toArray(new GrantedAuthority[l.size()]); }
/** * Returns the root {@link ACL}. * * @see AuthorizationStrategy#getRootACL() */ @Override public ACL getACL() { return authorizationStrategy.getRootACL(); }
public static List<Descriptor<AuthorizationStrategy>> getAuthorizationStrategyDescriptors() { return AuthorizationStrategy.all(); }
public Descriptor<AuthorizationStrategy> superGetDescriptor() { return super.getDescriptor(); }
j.setDisableRememberMe(security.optBoolean("disableRememberMe", false)); j.setSecurityRealm(SecurityRealm.all().newInstanceFromRadioList(security, "realm")); j.setAuthorizationStrategy(AuthorizationStrategy.all().newInstanceFromRadioList(security, "authorization")); } else { j.disableSecurity();
@Override public Descriptor<AuthorizationStrategy> getDescriptor() { initPython(); if (pexec.isImplemented(7)) { return (Descriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } }
/** * Implementation can choose to provide different ACL for different computers. * This can be used as a basis for more fine-grained access control. * * <p> * The default implementation delegates to {@link #getACL(Node)} * * @since 1.220 */ public @Nonnull ACL getACL(@Nonnull Computer computer) { return getACL(computer.getNode()); }
/** * Implementation can choose to provide different ACL for different items. * This can be used as a basis for more fine-grained access control. * * <p> * The default implementation returns {@link #getRootACL()}. * * @since 1.220 */ public @Nonnull ACL getACL(@Nonnull AbstractItem item) { return getRootACL(); }
public static List<Descriptor<AuthorizationStrategy>> getAuthorizationStrategyDescriptors() { return AuthorizationStrategy.all(); }
/** * Servlet container can tie a {@link ServletRequest} to the request handling thread, * so we need to capture all the information upfront to allow {@link Authentication} * to be passed to other threads, like update center does. See HUDSON-5382. */ public ContainerAuthentication(HttpServletRequest request) { this.principal = request.getUserPrincipal(); if (principal==null) throw new IllegalStateException(); // for anonymous users, we just don't call SecurityContextHolder.getContext().setAuthentication. // Servlet API doesn't provide a way to list up all roles the current user // has, so we need to ask AuthorizationStrategy what roles it is going to check against. List<GrantedAuthority> l = new ArrayList<GrantedAuthority>(); for( String g : Jenkins.getInstance().getAuthorizationStrategy().getGroups()) { if(request.isUserInRole(g)) l.add(new GrantedAuthorityImpl(g)); } l.add(SecurityRealm.AUTHENTICATED_AUTHORITY); authorities = l.toArray(new GrantedAuthority[l.size()]); }
/** * Returns the {@link ACL} for this object. */ public ACL getACL() { return Jenkins.getInstance().getAuthorizationStrategy().getACL(this); }
/** * Implementation can choose to provide different ACL per user. * This can be used as a basis for more fine-grained access control. * * <p> * The default implementation returns {@link #getRootACL()}. * * @since 1.221 */ public @Nonnull ACL getACL(@Nonnull User user) { return getRootACL(); }
public static List<Descriptor<AuthorizationStrategy>> getAuthorizationStrategyDescriptors() { return AuthorizationStrategy.all(); }
/** * Servlet container can tie a {@link ServletRequest} to the request handling thread, * so we need to capture all the information upfront to allow {@link Authentication} * to be passed to other threads, like update center does. See HUDSON-5382. */ public ContainerAuthentication(HttpServletRequest request) { this.principal = request.getUserPrincipal(); if (principal==null) throw new IllegalStateException(); // for anonymous users, we just don't call SecurityContextHolder.getContext().setAuthentication. // Servlet API doesn't provide a way to list up all roles the current user // has, so we need to ask AuthorizationStrategy what roles it is going to check against. List<GrantedAuthority> l = new ArrayList<GrantedAuthority>(); for( String g : Hudson.getInstance().getAuthorizationStrategy().getGroups()) { if(request.isUserInRole(g)) l.add(new GrantedAuthorityImpl(g)); } l.add(SecurityRealm.AUTHENTICATED_AUTHORITY); authorities = l.toArray(new GrantedAuthority[l.size()]); }
/** * Returns the {@link ACL} for this object. */ public ACL getACL() { return Jenkins.getInstance().getAuthorizationStrategy().getACL(this); }
/** * Implementation can choose to provide different ACL for different {@link Cloud}s. * This can be used as a basis for more fine-grained access control. * * <p> * The default implementation returns {@link #getRootACL()}. * * @since 1.252 */ public @Nonnull ACL getACL(@Nonnull Cloud cloud) { return getRootACL(); }
public static List<Descriptor<AuthorizationStrategy>> getAuthorizationStrategyDescriptors() { return AuthorizationStrategy.all(); }
/** * Servlet container can tie a {@link ServletRequest} to the request handling thread, * so we need to capture all the information upfront to allow {@link Authentication} * to be passed to other threads, like update center does. See HUDSON-5382. */ public ContainerAuthentication(HttpServletRequest request) { this.principal = request.getUserPrincipal(); if (principal==null) throw new IllegalStateException(); // for anonymous users, we just don't call SecurityContextHolder.getContext().setAuthentication. // Servlet API doesn't provide a way to list up all roles the current user // has, so we need to ask AuthorizationStrategy what roles it is going to check against. List<GrantedAuthority> l = new ArrayList<GrantedAuthority>(); for( String g : Hudson.getInstance().getAuthorizationStrategy().getGroups()) { if(request.isUserInRole(g)) l.add(new GrantedAuthorityImpl(g)); } l.add(SecurityRealm.AUTHENTICATED_AUTHORITY); authorities = l.toArray(new GrantedAuthority[l.size()]); }
/** * Returns the {@link ACL} for this object. * We need to override the identical method in AbstractItem because we won't * call getACL(Job) otherwise (single dispatch) */ @Override public ACL getACL() { return Jenkins.getInstance().getAuthorizationStrategy().getACL(this); }