NIHVIVO-3404 Rename accessor methods on AbstractObjectPropertyStatementAction to be consistent with those on AbstractDataPropertyStatementAction.
This commit is contained in:
parent
5ecf031bae
commit
e8fafcc10c
5 changed files with 27 additions and 27 deletions
|
@ -88,9 +88,9 @@ public class EditByRolePermission extends Permission {
|
|||
* to modify its subject, its predicate, and its object.
|
||||
*/
|
||||
private boolean isAuthorized(AbstractObjectPropertyStatementAction action) {
|
||||
String subjectUri = action.getUriOfSubject();
|
||||
String predicateUri = action.getUriOfPredicate();
|
||||
String objectUri = action.getUriOfObject();
|
||||
String subjectUri = action.getSubjectUri();
|
||||
String predicateUri = action.getPredicateUri();
|
||||
String objectUri = action.getObjectUri();
|
||||
return canModifyResource(subjectUri)
|
||||
&& canModifyPredicate(predicateUri)
|
||||
&& canModifyResource(objectUri);
|
||||
|
|
|
@ -34,9 +34,9 @@ public class RestrictHomeMenuItemEditingPolicy implements PolicyIface {
|
|||
|
||||
private PolicyDecision isAuthorized(
|
||||
AbstractObjectPropertyStatementAction whatToAuth) {
|
||||
if (whatToAuth.getUriOfPredicate()
|
||||
if (whatToAuth.getPredicateUri()
|
||||
.equals(DisplayVocabulary.HAS_ELEMENT)
|
||||
&& whatToAuth.getUriOfObject().equals(
|
||||
&& whatToAuth.getObjectUri().equals(
|
||||
DisplayVocabulary.HOME_MENU_ITEM)) {
|
||||
return notAuthorized();
|
||||
} else {
|
||||
|
|
|
@ -68,9 +68,9 @@ public class SelfEditingPolicy extends BaseSelfEditingPolicy implements
|
|||
*/
|
||||
private PolicyDecision isAuthorizedForObjectPropertyAction(
|
||||
List<String> userUris, AbstractObjectPropertyStatementAction action) {
|
||||
String subject = action.getUriOfSubject();
|
||||
String predicate = action.getUriOfPredicate();
|
||||
String object = action.getUriOfObject();
|
||||
String subject = action.getSubjectUri();
|
||||
String predicate = action.getPredicateUri();
|
||||
String object = action.getObjectUri();
|
||||
|
||||
if (!canModifyResource(subject)) {
|
||||
return cantModifyResource(subject);
|
||||
|
|
|
@ -9,32 +9,32 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAct
|
|||
* property.
|
||||
*/
|
||||
public abstract class AbstractObjectPropertyStatementAction extends RequestedAction {
|
||||
private final String uriOfSubject;
|
||||
private final String uriOfPredicate;
|
||||
private final String uriOfObject;
|
||||
private final String subjectUri;
|
||||
private final String predicateUri;
|
||||
private final String objectUri;
|
||||
|
||||
public AbstractObjectPropertyStatementAction(String uriOfSubject, String uriOfPredicate,
|
||||
String uriOfObject) {
|
||||
this.uriOfSubject = uriOfSubject;
|
||||
this.uriOfPredicate = uriOfPredicate;
|
||||
this.uriOfObject = uriOfObject;
|
||||
public AbstractObjectPropertyStatementAction(String subjectUri, String predicateUri,
|
||||
String objectUri) {
|
||||
this.subjectUri = subjectUri;
|
||||
this.predicateUri = predicateUri;
|
||||
this.objectUri = objectUri;
|
||||
}
|
||||
|
||||
public String getUriOfSubject() {
|
||||
return uriOfSubject;
|
||||
public String getSubjectUri() {
|
||||
return subjectUri;
|
||||
}
|
||||
|
||||
public String getUriOfPredicate() {
|
||||
return uriOfPredicate;
|
||||
public String getPredicateUri() {
|
||||
return predicateUri;
|
||||
}
|
||||
|
||||
public String getUriOfObject() {
|
||||
return uriOfObject;
|
||||
public String getObjectUri() {
|
||||
return objectUri;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + ": <" + uriOfSubject + "> <"
|
||||
+ uriOfPredicate + "> <" + uriOfObject + ">";
|
||||
return this.getClass().getSimpleName() + ": <" + subjectUri + "> <"
|
||||
+ predicateUri + "> <" + objectUri + ">";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -257,10 +257,10 @@ public class PolicyHelper_StatementsTest extends AbstractTestClass {
|
|||
|
||||
private PolicyDecision isAuthorized(
|
||||
AbstractObjectPropertyStatementAction whatToAuth) {
|
||||
if ((APPROVED_SUBJECT_URI.equals(whatToAuth.getUriOfSubject()))
|
||||
if ((APPROVED_SUBJECT_URI.equals(whatToAuth.getSubjectUri()))
|
||||
&& (APPROVED_PREDICATE_URI
|
||||
.equals(whatToAuth.getUriOfPredicate()))
|
||||
&& (APPROVED_OBJECT_URI.equals(whatToAuth.getUriOfObject()))) {
|
||||
.equals(whatToAuth.getPredicateUri()))
|
||||
&& (APPROVED_OBJECT_URI.equals(whatToAuth.getObjectUri()))) {
|
||||
return authorized();
|
||||
} else {
|
||||
return inconclusive();
|
||||
|
|
Loading…
Add table
Reference in a new issue