/// <summary>
        /// Returns true if RolePermissionViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of RolePermissionViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RolePermissionViewModel other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     RoleId == other.RoleId ||
                     RoleId.Equals(other.RoleId)
                     ) &&
                 (
                     PermissionId == other.PermissionId ||
                     PermissionId.Equals(other.PermissionId)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ));
        }
Ejemplo n.º 2
0
        // The following methods support the delta reports
        public bool Equals([AllowNull] UserRoleAllDTO other)
        {
            // Check whether the compared object is null.
            if (other is null)
            {
                return(false);
            }

            // Check whether the compared object references the same data.
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            // Check whether the objects’ properties are equal.
            return(UserId.Equals(other.UserId) &&
                   UserFullName.Equals(other.UserFullName) &&

                   RoleId.Equals(other.RoleId) &&
                   RoleName.Equals(other.RoleName) &&
                   RoleDescription.Equals(other.RoleDescription) &&
                   RoleOwner_RoleId.Equals(other.RoleOwner_RoleId) &&

                   LastCertifiedBy.Equals(other.LastCertifiedBy) &&
                   LastCertifiedDate.Equals(other.LastCertifiedDate));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns true if UserRoleViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of UserRoleViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UserRoleViewModel other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EffectiveDate == other.EffectiveDate ||
                     EffectiveDate.Equals(other.EffectiveDate)
                     ) &&
                 (
                     UserId == other.UserId ||
                     UserId.Equals(other.UserId)
                 ) &&
                 (
                     RoleId == other.RoleId ||
                     RoleId.Equals(other.RoleId)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     ExpiryDate == other.ExpiryDate ||
                     ExpiryDate != null &&
                     ExpiryDate.Equals(other.ExpiryDate)
                 ));
        }
Ejemplo n.º 4
0
 public bool Equals(Integration other)
 {
     return(Id.Equals(other.Id) && Name == other.Name && Type == other.Type && Enabled == other.Enabled &&
            Syncing == other.Syncing && RoleId.Equals(other.RoleId) &&
            EnableEmoticons == other.EnableEmoticons && ExpireBehavior == other.ExpireBehavior &&
            ExpireGracePeriod == other.ExpireGracePeriod && User.Equals(other.User) &&
            Account.Equals(other.Account) && SyncedAt.Equals(other.SyncedAt));
 }
        // The following methods support the delta reports

        // Handle equals for everything but the managers / service owners isCertified and the
        // risk rating. The isCertified stuff gets reset everytime a new cycle happens and
        // risk rating is calculated from threat and likelihood ratings so we can ignore those
        public bool Equals([AllowNull] RoleServicePrivAllDTO other)
        {
            // Check whether the compared object is null.
            if (other is null)
            {
                return(false);
            }

            // Check whether the compared object references the same data.
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            // Check whether the objects’ properties are equal.
            // Role stuff
            return(RolePrivId.Equals(other.RolePrivId) &&
                   RoleId.Equals(other.RoleId) &&
                   RoleName.Equals(other.RoleName) &&
                   RoleDescription.Equals(other.RoleDescription) &&
                   RoleOwner_RoleId.Equals(other.RoleOwner_RoleId) &&

                   // Manager stuff
                   RoleOwner_PrivId.Equals(other.RoleOwner_PrivId) &&
                   RoleOwner_PermissionGroup.Equals(other.RoleOwner_PermissionGroup) &&
                   RoleOwner_ServicePrivSummary.Equals(other.RoleOwner_ServicePrivSummary) &&
                   RoleOwner_CredentialStorageMethod.Equals(other.RoleOwner_CredentialStorageMethod) &&
                   RoleOwner_ServiceId.Equals(other.RoleOwner_ServiceId) &&
                   RoleOwner_ServiceName.Equals(other.RoleOwner_ServiceName) &&
                   RoleOwner_ServiceDescription.Equals(other.RoleOwner_ServiceDescription) &&

                   RoleOwner_RoleAccessJustification.Equals(other.RoleOwner_RoleAccessJustification) &&
                   RoleOwner_RemovalImpact.Equals(other.RoleOwner_RemovalImpact) &&
                   RoleOwner_IsRevoked.Equals(other.RoleOwner_IsRevoked) &&
                   RoleOwner_DateCertified.Equals(other.RoleOwner_DateCertified));/* &&
                                                                                   *
                                                                                   * // Service Owner Stuff
                                                                                   * ServiceOwner_PrivId.Equals(other.ServiceOwner_PrivId) &&
                                                                                   * ServiceOwner_PermissionGroup.Equals(other.ServiceOwner_PermissionGroup) &&
                                                                                   * ServiceOwner_ServicePrivSummary.Equals(other.ServiceOwner_ServicePrivSummary) &&
                                                                                   * ServiceOwner_CredentialStorageMethod.Equals(other.ServiceOwner_CredentialStorageMethod) &&
                                                                                   * ServiceOwner_ServiceId.Equals(other.ServiceOwner_ServiceId) &&
                                                                                   * ServiceOwner_ServiceName.Equals(other.ServiceOwner_ServiceName) &&
                                                                                   * ServiceOwner_ServiceDescription.Equals(other.ServiceOwner_ServiceDescription) &&
                                                                                   *
                                                                                   * ServiceOwner_RoleAccessJustification.Equals(other.ServiceOwner_RoleAccessJustification) &&
                                                                                   * ServiceOwner_RemovalImpact.Equals(other.ServiceOwner_RemovalImpact) &&
                                                                                   * ServiceOwner_IsRevoked.Equals(other.ServiceOwner_IsRevoked) &&
                                                                                   * ServiceOwner_DateCertified.Equals(other.ServiceOwner_DateCertified) &&
                                                                                   *
                                                                                   * // Risk stuff
                                                                                   * RiskImpact.Equals(other.RiskImpact) &&
                                                                                   * RiskLikelihood.Equals(other.RiskLikelihood) &&
                                                                                   * RiskNotes.Equals(other.RiskNotes) &&
                                                                                   * RiskAssessmentDate.Equals(other.RiskAssessmentDate);*/
        }
Ejemplo n.º 6
0
        public bool Equals(Role other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            return(ReferenceEquals(this, other) ||
                   (RoleId.Equals(other.RoleId) && RoleName.Equals(other.RoleName)));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Returns true if Employee instances are equal
        /// </summary>
        /// <param name="other">Instance of Employee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Employee other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     ContractTypeName == other.ContractTypeName ||
                     ContractTypeName != null &&
                     ContractTypeName.Equals(other.ContractTypeName)
                 ) &&
                 (
                     RoleId == other.RoleId ||
                     RoleId != null &&
                     RoleId.Equals(other.RoleId)
                 ) &&
                 (
                     RoleName == other.RoleName ||
                     RoleName != null &&
                     RoleName.Equals(other.RoleName)
                 ) &&
                 (
                     RoleDescription == other.RoleDescription ||
                     RoleDescription != null &&
                     RoleDescription.Equals(other.RoleDescription)
                 ) &&
                 (
                     HourlySalary == other.HourlySalary ||
                     HourlySalary != null &&
                     HourlySalary.Equals(other.HourlySalary)
                 ) &&
                 (
                     MonthlySalary == other.MonthlySalary ||
                     MonthlySalary != null &&
                     MonthlySalary.Equals(other.MonthlySalary)
                 ));
        }
Ejemplo n.º 8
0
 public bool Equals(MembershipRole other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(false);
     }
     if (Object.ReferenceEquals(this, other))
     {
         return(true);
     }
     return(RoleName.Equals(other.RoleName) && RoleId.Equals(other.RoleId));
 }
Ejemplo n.º 9
0
        //Please note that interface IEquatable<Role> is required for Except linq method that uses in member service - do not delete code below
        //compare from IEquatable for except method when we set delete flag for absent roles
        public bool Equals(Role other)
        {
            if (Object.ReferenceEquals(other, null))
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, other))
            {
                return(true);
            }

            return(RoleId.Equals(other.RoleId) && ManagementDepartmentId.Equals(other.ManagementDepartmentId));
        }
Ejemplo n.º 10
0
        public override bool Equals(Base other)
        {
            if (other == null)
            {
                return(false);
            }
            if (other is ModuleRole ModuleRole)
            {
                return(ModuleId.Equals(ModuleRole.ModuleId) && RoleId.Equals(ModuleRole.RoleId));
            }

            return(false);
        }
Ejemplo n.º 11
0
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is ApplicationUserRole))
            {
                return(false);
            }

            if (string.IsNullOrEmpty(UserId) || string.IsNullOrEmpty(RoleId))
            {
                return(false);
            }

            return(UserId.Equals((obj as ApplicationUserRole).UserId) &&
                   RoleId.Equals((obj as ApplicationUserRole).RoleId));
        }
Ejemplo n.º 12
0
        public bool Equals(RoleModulePermissionModel rmpm)
        {
            //Check whether the compared object is null.
            if (Object.ReferenceEquals(rmpm, null))
            {
                return(false);
            }

            //Check whether the compared object references the same data.
            if (Object.ReferenceEquals(this, rmpm))
            {
                return(true);
            }

            //Check whether the objects properties are equal.
            return(RoleId.Equals(rmpm.RoleId) && ModuleId.Equals(rmpm.ModuleId) && PermissionId.Equals(rmpm.PermissionId));
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Returns true if Authorization instances are equal
        /// </summary>
        /// <param name="other">Instance of Authorization to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Authorization other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     ResourceId == other.ResourceId ||
                     ResourceId != null &&
                     ResourceId.Equals(other.ResourceId)
                 ) &&
                 (
                     RoleId == other.RoleId ||
                     RoleId != null &&
                     RoleId.Equals(other.RoleId)
                 ) &&
                 (
                     PolicyId == other.PolicyId ||
                     PolicyId != null &&
                     PolicyId.Equals(other.PolicyId)
                 ) &&
                 (
                     ScopeMap == other.ScopeMap ||
                     ScopeMap != null &&
                     ScopeMap.Equals(other.ScopeMap)
                 ));
        }
Ejemplo n.º 14
0
 protected bool Equals(DUserRole other)
 {
     return(UserId.Equals(other.UserId) && RoleId.Equals(other.RoleId));
 }
Ejemplo n.º 15
0
 protected bool Equals(Role other)
 {
     return(RoleId.Equals(other.RoleId) && string.Equals(RoleName, other.RoleName) && string.Equals(Description, other.Description));
 }
Ejemplo n.º 16
0
 public override bool Equals(object obj)
 {
     return(RoleId.Equals(((Role)obj).RoleId));
 }