Доступ Acumatica по типу заказа на продажу - PullRequest
0 голосов
/ 26 мая 2020

Добрый день

Как ограничить пользователям Acumatica доступ только к определенным Типам заказов на продажу?

Спасибо

1 Ответ

0 голосов
/ 01 июня 2020

Это старый код, но вы можете попробовать ограничить его в соответствии с ролью. В этом примере пользователи с гостевой ролью ограничены типами 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) { }
...