* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.wamblee.security.authorization;
import static org.wamblee.security.authorization.AuthorizationResult.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.CascadeType;
import javax.persistence.OneToOne;
import javax.persistence.Transient;
-import org.apache.log4j.Logger;
import org.wamblee.security.authentication.UserAdministration;
/**
* appropriate is determined by a
* {@link org.wamblee.security.authorization.AbstractUserCondition}.</li>
* <li>The operation that is requested. Whether the operation is appropriate is
- * determined by a {@link org.wamblee.security.authorization.AbstractOperationCondition}
- * .</li>
+ * determined by a
+ * {@link org.wamblee.security.authorization.AbstractOperationCondition} .</li>
* </ul>
* In case all three conditions match, the condition returns the configured
* result passed at construction (GRANTED or DENIED). If the resource is not of
@Access(AccessType.PROPERTY)
public abstract class UrlAuthorizationRule extends AbstractAuthorizationRule {
private static final Logger LOGGER = Logger
- .getLogger(UrlAuthorizationRule.class);
+ .getLogger(UrlAuthorizationRule.class.getName());
/**
* Result that the rule will return in case there is a match.
/**
* Operation that this rule is for.
*/
-
+
private OperationCondition operationCondition;
/**
*
* @return Authorization result,
*/
- protected AuthorizationResult isAllowedWithPath(String aPath, Operation aOperation,
- String aUser) {
+ protected AuthorizationResult isAllowedWithPath(String aPath,
+ Operation aOperation, String aUser) {
if (!pathCondition.matches(aPath)) {
return UNDECIDED;
}
try {
resourceClass = Class.forName(aResourceClass);
} catch (ClassNotFoundException e) {
- LOGGER.error("Cannot find resource class '" + aResourceClass + "'",
- e);
+ LOGGER.log(Level.SEVERE, "Cannot find resource class '" +
+ aResourceClass + "'", e);
throw new IllegalArgumentException(e.getMessage(), e);
}
}
protected void setUserCondition(UserCondition aUserCondition) {
userCondition = aUserCondition;
}
-
+
@Override
public void setUserAdministration(UserAdministration aAdmin) {
- userCondition.setUserAdmin(aAdmin);
+ userCondition.setUserAdmin(aAdmin);
}
}