// Path: spanners-mvc/src/main/java/org/dontpanic/spanners/springmvc/domain/Spanner.java
// public class Spanner {
// 
//     private Long id;
//     private String name;
//     private int size;
//     private String owner;
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public int getSize() {
//         return size;
//     }
// 
//     public void setSize(int size) {
//         this.size = size;
//     }
// 
//     public String getOwner() {
//         return owner;
//     }
// 
//     public void setOwner(String owner) {
//         this.owner = owner;
//     }
// }


import org.dontpanic.spanners.springmvc.domain.Spanner;
import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import java.io.Serializable;
package org.dontpanic.spanners.springmvc;



/**
 * Override sstandard Spring ACL based security for one with an awareness of the subtleties of spanners.
 * User: Stevie
 * Date: 11/08/12
 */
@Component
public class SpannerPermissionEvaluator implements PermissionEvaluator{

    public static final String OWNER = "owner";

    @Override
    public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission) {
        boolean hasPermission = false;
// Path: spanners-mvc/src/main/java/org/dontpanic/spanners/springmvc/domain/Spanner.java
// public class Spanner {
// 
//     private Long id;
//     private String name;
//     private int size;
//     private String owner;
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public int getSize() {
//         return size;
//     }
// 
//     public void setSize(int size) {
//         this.size = size;
//     }
// 
//     public String getOwner() {
//         return owner;
//     }
// 
//     public void setOwner(String owner) {
//         this.owner = owner;
//     }
// }


// Path: spanners-mvc/src/main/java/org/dontpanic/spanners/springmvc/SpannerPermissionEvaluator.java
import org.dontpanic.spanners.springmvc.domain.Spanner;
import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import java.io.Serializable;

package org.dontpanic.spanners.springmvc;



/**
 * Override sstandard Spring ACL based security for one with an awareness of the subtleties of spanners.
 * User: Stevie
 * Date: 11/08/12
 */
@Component
public class SpannerPermissionEvaluator implements PermissionEvaluator{

    public static final String OWNER = "owner";

    @Override
    public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission) {
        boolean hasPermission = false;
        if (targetDomainObject instanceof Spanner && permission.toString().equals(OWNER)) {