@@ -0,0 +1,3183 @@
+package org.jasig.portal.services;%0A%0Aimport  java.util.Vector;%0Aimport  java.io.File;%0Aimport  java.io.FileInputStream;%0Aimport  java.io.IOException;%0Aimport  java.util.Properties;%0Aimport  org.jasig.portal.PortalSessionManager;%0Aimport  org.jasig.portal.security.*;%0Aimport  org.jasig.portal.AuthorizationException;%0A%0A/**%0A * @author Bernie Durfee, bdurfee@interactivebusiness.com%0A * @author Dan Ellentuck%0A * @version $Revision$%0A */%0Apublic class AuthorizationService %0A%7B%0A  private static AuthorizationService m_instance;  %0A  protected IAuthorizationService m_authorization = null;%0A  protected static String s_factoryName = null;%0A  protected static IAuthorizationServiceFactory m_Factory = null;%0A  static %7B%0A    // Get the security properties file%0A    java.io.InputStream secprops = AuthorizationService.class.getResourceAsStream(%22/properties/security.properties%22);%0A    // Get the properties from the security properties file%0A    Properties pr = new Properties();%0A    try %7B%0A      pr.load(secprops);%0A      // Look for our authorization factory and instantiate an instance of it or die trying.%0A      if ((s_factoryName = pr.getProperty(%22authorizationProvider%22)) == null) %7B%0A        LogService.instance().log(LogService.ERROR, new PortalSecurityException(%22AuthorizationProvider not specified or incorrect in security.properties%22));%0A      %7D%0A      else %7B%0A        try %7B%0A          m_Factory = (IAuthorizationServiceFactory)Class.forName(s_factoryName).newInstance();%0A        %7D catch (Exception e) %7B%0A          LogService.instance().log(LogService.ERROR, new PortalSecurityException(%22Failed to instantiate %22 + s_factoryName));%0A        %7D%0A      %7D%0A    %7D catch (IOException e) %7B%0A      LogService.instance().log(LogService.ERROR, new PortalSecurityException(e.getMessage()));%0A    %7D%0A  %7D%0A%0A/**%0A *%0A */%0Apublic AuthorizationService () throws AuthorizationException%0A%7B%0A    // From our factory get an actual authorization instance%0A    m_authorization = m_Factory.getAuthorization();%0A%7D%0A/**%0A * @return Authorization%0A */%0Apublic final static synchronized AuthorizationService instance() throws AuthorizationException %0A%7B%0A%09if ( m_instance == null )%0A%09%09%7B m_instance = new AuthorizationService(); %7D%0A%09return m_instance;%0A%7D%0A/**%0A * @return org.jasig.portal.security.IPermissionManager%0A * @param owner java.lang.String%0A * @exception org.jasig.portal.AuthorizationException%0A */%0Apublic IPermissionManager newPermissionManager(String owner) %0A       throws AuthorizationException %0A%7B%0A     return m_authorization.newPermissionManager(owner);%0A%7D%0A/**%0A * @return org.jasig.portal.security.IAuthorizationPrincipal%0A * @param key java.lang.String%0A * @param type java.lang.Class%0A * @exception org.jasig.portal.AuthorizationException%0A */%0Apublic IAuthorizationPrincipal newPrincipal(String key, Class type) %0A       throws AuthorizationException %0A%7B%0A     return m_authorization.newPrincipal(key, type);%0A%7D%0A/**%0A * @return org.jasig.portal.security.IUpdatingPermissionManager%0A * @param owner java.lang.String%0A * @exception org.jasig.portal.AuthorizationException%0A */%0Apublic IUpdatingPermissionManager newUpdatingPermissionManager(String owner) %0A       throws AuthorizationException %0A%7B%0A     return m_authorization.newUpdatingPermissionManager(owner);%0A%7D%0A%7D%0A

Add groups-aware authorization service