【问题标题】:Acumatica Access by Sales Order Type按销售订单类型访问 Acumatica
【发布时间】:2020-05-26 10:25:57
【问题描述】:

美好的一天

如何限制 Acumatica 中的用户只能访问某些销售订单类型?

谢谢

【问题讨论】:

  • Acumatica 对此没有任何开箱即用的解决方案。您必须进行一些自定义才能实现此行为。

标签: acumatica


【解决方案1】:

这是较旧的代码,但您可以尝试根据角色进行限制。在本例中,Guest Role 用户仅限于 IN 和 TR OrderTypes:

    [PXDBString(2, IsKey = true, IsFixed = true, InputMask = ">aa")]
    [PXDefault(SOOrderTypeConstants.SalesOrder, typeof(SOSetup.defaultOrderType))]
    [PXSelector(typeof(Search5<SOOrderType.orderType,
        InnerJoin<SOOrderTypeOperation, On<SOOrderTypeOperation.orderType,
            Equal<SOOrderType.orderType>, And<SOOrderTypeOperation.operation, Equal<SOOrderType.defaultOperation>>>,
        LeftJoin<SOSetupApproval, On<SOOrderType.orderType, Equal<SOSetupApproval.orderType>>
            , InnerJoin<Users, On<Current<AccessInfo.userName>, Equal<Users.username>>
            , InnerJoin<UsersInRoles, On<Users.username, Equal<UsersInRoles.username>>
            , InnerJoin<Roles, On<Roles.rolename, Equal<UsersInRoles.rolename>>>>>>>,
         Where2<Where<Roles.guest, Equal<False>>,
                Or<Where<SOOrderType.orderType, Equal<string_IN>,
                        Or<SOOrderType.orderType, Equal<string_TR>>>>>,
        Aggregate<GroupBy<SOOrderType.orderType>>>))]
    [PXRestrictor(typeof(Where<SOOrderTypeOperation.iNDocType, NotEqual<INTranType.transfer>,
        Or<FeatureInstalled<FeaturesSet.warehouse>>>), ErrorMessages.ElementDoesntExist, typeof(SOOrderType.orderType))]
    [PXRestrictor(typeof(Where<SOOrderType.requireAllocation, NotEqual<True>,
        Or<AllocationAllowed>>), ErrorMessages.ElementDoesntExist, typeof(SOOrderType.orderType))]
    [PXRestrictor(typeof(Where<SOOrderType.active, Equal<True>>), null)]
    [PXUIField(DisplayName = "Order Type", Visibility = PXUIVisibility.SelectorVisible)]
    [PX.Data.EP.PXFieldDescription]
    protected virtual void SOOrder_OrderType_CacheAttached(PXCache sender) { }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-15
    • 1970-01-01
    相关资源
    最近更新 更多