예제 #1
0
파일: user.py 프로젝트: RahyabGroup/PyCore
 def claim_add_by_claim_type_name(self, claim_type_name, claim_value):
     from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType
     claim_type = ClaimType.get_by_name(claim_type_name)
     claim = Claim()
     claim.claim_type_id = claim_type._id
     claim.value = claim_value
     self.claim_add(claim)
예제 #2
0
파일: user.py 프로젝트: Hoomanfr/pycore
    def create(self):
        from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType

        user_name_claim_type = ClaimType.get_by_name("USER_NAME")

        user_default_claim = Claim()
        user_default_claim.claim_type_id = user_name_claim_type._id
        user_default_claim.value = self.user_name

        self.claims.append(user_default_claim)

        user_writer.create(self)
예제 #3
0
파일: user.py 프로젝트: RahyabGroup/PyCore
    def create(self):
        from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType

        user_name_claim_type = ClaimType.get_by_name("USER_NAME")

        user_default_claim = Claim()
        user_default_claim.claim_type_id = user_name_claim_type._id
        user_default_claim.value = self.user_name
        self.claims.append(user_default_claim)

        self.status = Status.activated
        bcrypt = Bcrypt(None)
        password_hash = bcrypt.generate_password_hash(self.password)
        self.password = password_hash
        user_writer.create(self)
예제 #4
0
파일: user.py 프로젝트: RahyabGroup/PyCore
 def claims_get_by_claim_type_name(self, claim_type_name):
     from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType
     claim_type = ClaimType.get_by_name(claim_type_name)
     return user_reader.claims_get_claim_type_id(self._id, claim_type._id)
예제 #5
0
파일: user.py 프로젝트: RahyabGroup/PyCore
 def claim_edit_by_claim_type_name_with_value(self, claim_type_name, claim_old_value, claim_value):
     from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType
     claim_type = ClaimType.get_by_name(claim_type_name)
     user_writer.claim_edit_by_claim_type_name_with_value(self._id, claim_type._id, claim_old_value, claim_value)