@UpdatePermission(expression = "adminRoleCheck OR updateOnCreate") public int getRole() { return role; }
@UpdatePermission(expression = "negativeIntegerUser") public String getField4() { return field4; }
@UpdatePermission(expression = "deny all") @OneToOne( targetEntity = Left.class, fetch = FetchType.LAZY ) public Left getNoUpdateOne2One() { return noUpdateOne2One; }
@UpdatePermission(expression = "deny all") @OneToOne( targetEntity = Right.class, mappedBy = "noUpdateOne2One", fetch = FetchType.LAZY ) public Right getNoUpdateOne2One() { return noUpdateOne2One; }
@ManyToMany( mappedBy = "children", targetEntity = Parent.class ) // Contrived check for regression example. Should clean this up. No updating child 4 via parent 10 @UpdatePermission(expression = "child4Parent10") public Set<Parent> getParents() { return parents; }
@UpdatePermission(expression = "deny all") @ManyToMany( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, targetEntity = Left.class ) public Set<Left> getNoUpdate() { return noUpdate; }
@ReadPermission(expression = "negativeIntegerUser") @UpdatePermission(expression = "negativeIntegerUser") @OneToMany( targetEntity = Child.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE } ) public Set<Child> getRelation1() { return relation1; }
@ReadPermission(expression = "negativeIntegerUser") @UpdatePermission(expression = "negativeIntegerUser") @OneToOne (cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "child_id") public Child getRelation3() { return relation3; }
@ReadPermission(expression = "deny all") @UpdatePermission(expression = "parentSpecialValue") public String getSpecialAttribute() { return specialAttribute; }
/** * No Update test bean. */ @UpdatePermission(expression = "deny all") @Include(rootLevel = true, type = "noupdate") // optional here because class has this name // Hibernate @Entity @Table(name = "noupdate") public class NoUpdateEntity extends BaseId { @OneToMany() public Set<Child> children; }
@ReadPermission(expression = "allow all OR deny all") @UpdatePermission(expression = "allow all OR deny all") // Hibernate @ManyToMany( targetEntity = Child.class ) @JoinTable( name = "Parent_Child", joinColumns = @JoinColumn(name = "parent_id"), inverseJoinColumns = @JoinColumn(name = "child_id") ) @NotNull public Set<Child> getChildren() { return children; }
@ReadPermission(expression = "allow all") @CreatePermission(expression = "allow all") @UpdatePermission(expression = "allow all") @Entity public class NotIncludedResource extends BaseId { private String someParams; public String getSomeParams() { return someParams; } public void setSomeParams(String someParams) { this.someParams = someParams; } }
/** * No Update test bean. */ @CreatePermission(expression = "allow all AND noCommit") @UpdatePermission(expression = "allow all AND noCommit") @Include(rootLevel = true, type = "nocommit") // Hibernate @Entity @Table(name = "nocommit") public class NoCommitEntity extends BaseId { static public class NoCommitCheck<T> extends CommitCheck<T> { @Override public boolean ok(T record, RequestScope requestScope, Optional<ChangeSpec> changeSpec) { return false; } } }
@Entity @Include(rootLevel = true, type = "specialread") @ReadPermission(expression = "specialValue") @UpdatePermission(expression = "updateOnCreate") public class SpecialRead extends BaseId { private String value;
@Include(rootLevel = true) @ReadPermission(expression = "allow all") @CreatePermission(expression = "allow all") @UpdatePermission(expression = "allow all") @Entity public class OneToOneRoot extends BaseId { private String name; private OneToOneNonRoot otherObject; public String getName() { return name; } public void setName(String name) { this.name = name; } @OneToOne(fetch = FetchType.LAZY) public OneToOneNonRoot getOtherObject() { return otherObject; } public void setOtherObject(OneToOneNonRoot otherObject) { this.otherObject = otherObject; } }
@Include(rootLevel = true) @ReadPermission(expression = "allow all") @CreatePermission(expression = "allow all") @UpdatePermission(expression = "allow all") @Entity public class ResourceWithInvalidRelationship extends BaseId { private String name; private NotIncludedResource notIncludedResource; public String getName() { return name; } public void setName(String name) { this.name = name; } @OneToOne public NotIncludedResource getNotIncludedResource() { return notIncludedResource; } public void setNotIncludedResource(NotIncludedResource notIncludedResource) { this.notIncludedResource = notIncludedResource; } }
@Include(rootLevel = false) @ReadPermission(expression = "allow all") @CreatePermission(expression = "allow all") @UpdatePermission(expression = "allow all") @Entity public class OneToOneNonRoot extends BaseId { private String test; private OneToOneRoot root; public String getTest() { return test; } public void setTest(String test) { this.test = test; } @OneToOne(mappedBy = "otherObject", fetch = FetchType.LAZY) @PrimaryKeyJoinColumn public OneToOneRoot getRoot() { return root; } public void setRoot(OneToOneRoot root) { this.root = root; } }
@CreatePermission(expression = "allow all") @ReadPermission(expression = "allow all") @UpdatePermission(expression = "deny all") public class CreateButNoUpdate extends BaseId { private String textValue;
@ReadPermission(expression = "allow all") @CreatePermission(expression = "allow all") @UpdatePermission(expression = "allow all") @DeletePermission(expression = "allow all") @SharePermission
@UpdatePermission(expression = "allow all OR deny all") @DeletePermission(expression = "allow all OR deny all") @Include(rootLevel = true, type = "post") // optional here because class has this name