Open Closed

Feature To Organizational Unit #3233


0
ariandle created

I want to map Features to Organizational Units, similar to how we map Users to Organizational Units.

This works great for adding Users to Organizational Units : UserManager.AddToOrganizationUnitAsync

I want to extend the FeatureManager to also allow this sort of association.

I have created an entity like the example below, but need some advice from here.

[Table("IvFeatureOrganizationUnits")]
    public class FeatureOrganizationalUnit : FullAuditedEntity, IMayHaveTenant
    {
        public const int MaxNumberLength = 16;
        public virtual int? TenantId { get; set; }

        [ForeignKey("OrganizationUnitId")]
        public virtual OrganizationUnit OrganizationalUnit { get; set; }
        public virtual long OrganizationUnitId { get; set; }

        [ForeignKey("FeatureSettingId")]
        public virtual FeatureSetting FeatureSetting { get; set; }
        public virtual long FeatureSettingId { get; set; }
    }

Thanks!


1 Answer(s)
  • 0
    hikalkan created
    Support Team

    Can I learn that what is the use case and purpose of that. I think you than want to disable/enable features by OU, thus a user see the feature if assigned to that OU? Do you know that a feature can be simple true/false, but also can be an arbitrary value. And also a user is allowed to multiple UOs which may make it complicated.

    If your purpose is that, can't you simply use roles & permissions?