~Good morning. Can anyone tell what I am doing wro...
# spicedb
y
Good morning. Can anyone tell what I am doing wrong? I can't seem to write this relationship using the Java API. I am getting this error. Nevermind. I was looking at the wrong block of code. This works as expected 👍 "INVALID_ARGUMENT: subjects of type
organization_usergroup
are not allowed on relation `environment#accessor`; did you mean
organization_usergroup#member
?""
Copy code
yaml
defintion solution {
  relation launcher: user | organization_usergroup#member
}
Copy code
java
WriteRelationshipsRequest request = WriteRelationshipsRequest.newBuilder()
                .addUpdates(RelationshipUpdate.newBuilder()
                        .setOperation(RelationshipUpdate.Operation.OPERATION_TOUCH)
                        .setRelationship(Relationship.newBuilder()
                                .setResource(ObjectReference.newBuilder()
                                        .setObjectType("solution")
                                        .setObjectId(solutionId)
                                .setRelation("launcher")
                                .setSubject(SubjectReference.newBuilder()
                                        .setObject(ObjectReference.newBuilder()
                                                .setObjectType("organization_usergroup")
                                                .setObjectId(targetUserGroupId))
                                        .setOptionalRelation("member"))))
                .build();