def execute(self): resource = Resource() resource._id = self._id resource_claim = Claim() resource_claim.claim_type_id = self.claim_type_id resource_claim.value = self.claim_value resource.claim_add(resource_claim) return resource_claim._id
def create(self): from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType resource = Resource() permission_claim_type = ClaimType.get_permission() resource_default_claim = Claim() resource_default_claim.claim_type_id = permission_claim_type._id resource_default_claim.value = self.name resource.claims.append(resource_default_claim) resource_writer.create(self)