Merged revisions 8523-8525,8545-8556,8793,8803-8806,8858,9027-9028 via svnmerge from

https://www.dev.java.net/svn/hudson/branches/tom

........
  r8523 | huybrechts | 2008-04-11 13:41:11 -0700 (Fri, 11 Apr 2008) | 1 line
  
  profile to build against current snapshot of hudson-core
........
  r8524 | huybrechts | 2008-04-11 14:42:58 -0700 (Fri, 11 Apr 2008) | 1 line
  
  [#710] project option to automatically delete the svn wc if it is locked
........
  r8525 | huybrechts | 2008-04-11 14:53:59 -0700 (Fri, 11 Apr 2008) | 1 line
  
  [#710] project option to automatically delete the svn wc if it is locked
........
  r8545 | huybrechts | 2008-04-12 04:17:46 -0700 (Sat, 12 Apr 2008) | 1 line
  
  profile to build against current snapshot of hudson-core
........
  r8546 | huybrechts | 2008-04-12 04:19:26 -0700 (Sat, 12 Apr 2008) | 1 line
  
  deleting IDE-specific files
........
  r8547 | huybrechts | 2008-04-12 06:31:32 -0700 (Sat, 12 Apr 2008) | 1 line
  
  added ignores
........
  r8548 | huybrechts | 2008-04-12 06:42:49 -0700 (Sat, 12 Apr 2008) | 4 lines
  
  Issue 1158
  - extended AuthorizationStrategy to provide ACLs for different types of objects
  - changed several object types to use these methods
  - changed jelly to check permissions (instead of using isAdmin check)
........
  r8549 | huybrechts | 2008-04-12 06:44:26 -0700 (Sat, 12 Apr 2008) | 1 line
  
  Issue 1110: use svn revision number in project-changes.jelly
........
  r8550 | huybrechts | 2008-04-12 06:46:18 -0700 (Sat, 12 Apr 2008) | 1 line
  
  Adding a 'My Projects' view which shows only projects the user has permission for
........
  r8551 | huybrechts | 2008-04-12 06:47:57 -0700 (Sat, 12 Apr 2008) | 1 line
  
  adding a user name resolver, like the MailAddressResolver
........
  r8552 | huybrechts | 2008-04-12 06:49:27 -0700 (Sat, 12 Apr 2008) | 1 line
  
  Adding jdom and cglib to the war, as a workaround for classloading issues
........
  r8553 | huybrechts | 2008-04-12 08:01:58 -0700 (Sat, 12 Apr 2008) | 1 line
  
  SFEE integration improvements, including links to project based security
........
  r8554 | huybrechts | 2008-04-12 08:27:17 -0700 (Sat, 12 Apr 2008) | 1 line
  
  wsdl for SFEE webservices
........
  r8555 | huybrechts | 2008-04-12 08:31:18 -0700 (Sat, 12 Apr 2008) | 1 line
  
  forgot some files...
........
  r8556 | huybrechts | 2008-04-12 08:34:31 -0700 (Sat, 12 Apr 2008) | 1 line
  
  an authorization strategy that provides project-based access control (not usable on its own)
........
  r8793 | huybrechts | 2008-04-22 14:39:57 -0700 (Tue, 22 Apr 2008) | 1 line
  
  [issue #1573] allow plugins to contribute ServletFilters
........
  r8803 | huybrechts | 2008-04-23 10:46:09 -0700 (Wed, 23 Apr 2008) | 1 line
  
  added ignores
........
  r8804 | huybrechts | 2008-04-23 10:52:11 -0700 (Wed, 23 Apr 2008) | 1 line
  
  added ignores
........
  r8805 | huybrechts | 2008-04-23 10:54:12 -0700 (Wed, 23 Apr 2008) | 1 line
  
  added ignores
........
  r8806 | huybrechts | 2008-04-23 10:59:13 -0700 (Wed, 23 Apr 2008) | 1 line
  
  Issue 1158
........
  r8858 | huybrechts | 2008-04-25 08:17:41 -0700 (Fri, 25 Apr 2008) | 1 line
  
  bugfixes
........
  r9027 | huybrechts | 2008-05-04 12:20:34 -0700 (Sun, 04 May 2008) | 1 line
  
  Issue 1158 - fixing permission checks in jelly
........
  r9028 | huybrechts | 2008-05-04 12:22:36 -0700 (Sun, 04 May 2008) | 1 line
  
  creating SFEE releases from Hudson
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9699 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-05-30 03:25:15 +00:00
1 parent bae1fc3d91
commit f21fa55faf
36 files changed
+494 -75

No files matched your search

+36 -9
View File
@@ -1,28 +1,43 @@
package hudson;
import hudson.maven.ExecutedMojo;
import hudson.model.*;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.Descriptor;
import hudson.model.Hudson;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.Items;
import hudson.model.Job;
import hudson.model.JobPropertyDescriptor;
import hudson.model.ModelObject;
import hudson.model.Node;
import hudson.model.Project;
import hudson.model.Run;
import hudson.model.TopLevelItem;
import hudson.model.View;
import hudson.search.SearchableModelObject;
import hudson.security.AccessControlled;
import hudson.security.AuthorizationStrategy;
import hudson.security.Permission;
import hudson.security.SecurityRealm;
import hudson.slaves.ComputerLauncher;
import hudson.slaves.RetentionStrategy;
import hudson.tasks.BuildStep;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.BuildWrapper;
import hudson.tasks.BuildWrappers;
import hudson.tasks.Builder;
import hudson.tasks.Publisher;
import hudson.security.SecurityRealm;
import hudson.security.AuthorizationStrategy;
import hudson.security.Permission;
import hudson.util.Area;
import hudson.slaves.ComputerLauncher;
import hudson.slaves.RetentionStrategy;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
import org.apache.commons.jelly.JellyContext;
import org.apache.commons.jexl.parser.ASTSizeFunction;
import org.apache.commons.jexl.util.Introspector;
import org.apache.commons.jelly.JellyContext;
import org.kohsuke.stapler.Ancestor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
@@ -425,7 +440,15 @@ public class Functions {
}
public static void checkPermission(Permission permission) throws IOException, ServletException {
Hudson.getInstance().getACL().checkPermission(permission);
if (permission != null) {
Hudson.getInstance().getACL().checkPermission(permission);
}
}
public static void checkPermission(AccessControlled object, Permission permission) throws IOException, ServletException {
if (permission != null) {
object.checkPermission(permission);
}
}
/**
@@ -438,6 +461,10 @@ public class Functions {
return permission==null || Hudson.getInstance().getACL().hasPermission(permission);
}
public static boolean hasPermission(AccessControlled object, Permission permission) throws IOException, ServletException {
return permission==null || object.hasPermission(permission);
}
public static void adminCheck(StaplerRequest req, StaplerResponse rsp, Object required, Permission permission) throws IOException, ServletException {
// this is legacy --- all views should be eventually converted to
// the permission based model.