| Chunk |
|---|
| Conflicting content |
|---|
import javax.ws.rs.POST; import javax.ws.rs.DELETE; import javax.ws.rs.Consumes; <<<<<<< HEAD import javax.ws.rs.PathParam; ======= import javax.ws.rs.CookieParam; import javax.ws.rs.HeaderParam; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; >>>>>>> 6870789a4a1353d214dd2307d53d22170e72f2c4 import javax.ws.rs.core.Context; import static java.util.Arrays.asList; |
| Solution content |
|---|
import javax.ws.rs.POST; import javax.ws.rs.DELETE; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import static java.util.Arrays.asList; |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Import |
| Chunk |
|---|
| Conflicting content |
|---|
}
@Override
<<<<<<< HEAD
public void createACLEntry(DeepaMehtaObject object, Role role, Permissions permissions) {
TopicModel aclEntry = aclEntryModel(role, permissions);
facetsService.updateFacets(object, "dm4.accesscontrol.acl_facet", asList(aclEntry), null, null);
=======
public void createACLEntry(Topic topic, Role role, Permissions permissions) {
TopicModel aclEntry = createAclEntryModel(role, permissions);
// Note: acl_facet is a multi-facet. So we must pass a (one-element) list.
facetsService.updateFacets(topic, "dm4.accesscontrol.acl_facet", asList(aclEntry), null, null);
>>>>>>> 6870789a4a1353d214dd2307d53d22170e72f2c4
}
// --- |
| Solution content |
|---|
}
@Override
public void createACLEntry(DeepaMehtaObject object, Role role, Permissions permissions) {
TopicModel aclEntry = createAclEntryModel(role, permissions);
// Note: acl_facet is a multi-facet. So we must pass a (one-element) list.
facetsService.updateFacets(object, "dm4.accesscontrol.acl_facet", asList(aclEntry), null, null);
}
// --- |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Comment |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
// ---
<<<<<<< HEAD
/**
* Prerequisite: username is not |
| Solution content |
|---|
// ---
/**
* Assigns the logged in user as the creator of the specified object.
* If no user is logged in, the default user ("admin") is assigned.
*/
private void assignCreator(DeepaMehtaObject object) {
Topic username = getUsername();
//
if (username == null) {
logger.fine("Assigning a creator to " + info(object) + " failed (no user is logged in). " +
"The default user (\"admin\") is assigned instead.");
username = fetchAdminUser();
}
//
assignCreator(object, username.getId()); |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Combination |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method declaration |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
assignCreator(object, username.getId());
}
<<<<<<< HEAD
/**
* Assigns the specified user as the creator of the specified object.
*/
private void assignCreator(DeepaMehtaObject object, long usernameId) {
facetsService.updateFacet(object, "dm4.accesscontrol.creator_facet", creatorModel(usernameId), null, null);
=======
private void setCreator(Topic topic, long usernameId) {
facetsService.updateFacet(topic, "dm4.accesscontrol.creator_facet", createCreatorModel(usernameId), null, null);
>>>>>>> 6870789a4a1353d214dd2307d53d22170e72f2c4
}
// --- |
| Solution content |
|---|
assignCreator(object, username.getId());
}
/**
* Assigns the specified user as the creator of the specified object.
*/
private void assignCreator(DeepaMehtaObject object, long usernameId) {
TopicModel creatorValue = createCreatorModel(usernameId);
facetsService.updateFacet(object, "dm4.accesscontrol.creator_facet", creatorValue, null, null);
}
// --- |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Comment |
| Method invocation |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
* @param username the logged in user (a Topic of type "Username" / |
| Solution content |
|---|
* @param username the logged in user (a Topic of type "Username" / |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| For statement |
| Method invocation |
| Method signature |
| Chunk |
|---|
| Conflicting content |
|---|
// ---
<<<<<<< HEAD
/**
* Retrieves all ACL entries of the specified object.
*/
private Set |
| Solution content |
|---|
// ---
/**
* Retrieves the creator of an object, or |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Comment |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
private void enrichWithPermissions(DeepaMehtaObject object, boolean write) {
// Note: we must extend/override possibly existing permissions.
// Consider a type update: directive UPDATE_TOPIC_TYPE is followed by UPDATE_TOPIC, both on the same object.
<<<<<<< HEAD
CompositeValue permissions = getPermissions(object);
=======
CompositeValue permissions = permissions(topic);
>>>>>>> 6870789a4a1353d214dd2307d53d22170e72f2c4
permissions.put(Operation.WRITE.uri, write);
}
|
| Solution content |
|---|
private void enrichWithPermissions(DeepaMehtaObject object, boolean write) {
// Note: we must extend/override possibly existing permissions.
// Consider a type update: directive UPDATE_TOPIC_TYPE is followed by UPDATE_TOPIC, both on the same object.
CompositeValue permissions = permissions(object);
permissions.put(Operation.WRITE.uri, write);
}
|
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
// ---
<<<<<<< HEAD
private CompositeValue getPermissions(DeepaMehtaObject object) {
=======
private CompositeValue permissions(Topic topic) {
>>>>>>> 6870789a4a1353d214dd2307d53d22170e72f2c4
// Note: "dm4.accesscontrol.permissions" is a contrived URI. There is no such type definition.
// Permissions are transient data, not stored in DB, recalculated for each request.
TopicModel permissionsTopic = object.getCompositeValue().getTopic("dm4.accesscontrol.permissions", null); |
| Solution content |
|---|
// ---
private CompositeValue permissions(DeepaMehtaObject object) {
// Note: "dm4.accesscontrol.permissions" is a contrived URI. There is no such type definition.
// Permissions are transient data, not stored in DB, recalculated for each request.
TopicModel permissionsTopic = object.getCompositeValue().getTopic("dm4.accesscontrol.permissions", null); |
| File |
|---|
| AccessControlPlugin.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method signature |