コード例 #1
0
ファイル: SalesOrderItems.cs プロジェクト: Allors/apps
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };

            config.GrantAdministrator(this.ObjectType, full);

            var created = new SalesOrderItemObjectStates(Session).Created;
            var partiallyShipped = new SalesOrderItemObjectStates(Session).PartiallyShipped;
            var shipped = new SalesOrderItemObjectStates(Session).Shipped;
            var inProcess = new SalesOrderItemObjectStates(Session).InProcess;
            var cancelled = new SalesOrderItemObjectStates(Session).Cancelled;
            var rejected = new SalesOrderItemObjectStates(Session).Rejected;
            var completed = new SalesOrderItemObjectStates(Session).Completed;
            var finished = new SalesOrderItemObjectStates(Session).Finished;

            var product = Meta.Product;
            config.Deny(this.ObjectType, shipped, product);
            config.Deny(this.ObjectType, partiallyShipped, product);

            var cancel = Meta.Cancel;
            var reject = Meta.Reject;
            var delete = Meta.Delete;

            config.Deny(this.ObjectType, created, cancel, reject);
            config.Deny(this.ObjectType, partiallyShipped, delete, cancel, reject);
            config.Deny(this.ObjectType, shipped, delete, cancel, reject);
            config.Deny(this.ObjectType, inProcess, delete);

            config.Deny(this.ObjectType, cancelled, Operation.Execute, Operations.Write);
            config.Deny(this.ObjectType, rejected, Operation.Execute, Operations.Write);
            config.Deny(this.ObjectType, completed, Operation.Execute, Operations.Write);
            config.Deny(this.ObjectType, finished, Operation.Execute, Operations.Write);
        }
コード例 #2
0
ファイル: SalesInvoices.cs プロジェクト: Allors/apps
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };

            config.GrantAdministrator(this.ObjectType, full);
            config.GrantCustomer(this.ObjectType, Operations.Read);
            config.GrantSales(this.ObjectType, full);

            var sent = new SalesInvoiceObjectStates(Session).Sent;
            var paid = new SalesInvoiceObjectStates(Session).Paid;
            var partiallyPaid = new SalesInvoiceObjectStates(Session).PartiallyPaid;
            var writtenOff = new SalesInvoiceObjectStates(Session).WrittenOff;
            var cancelled = new SalesInvoiceObjectStates(Session).Cancelled;

            var sendId = Meta.Send;
            var cancelInvoiceId = Meta.CancelInvoice;

            config.Deny(this.ObjectType, sent, sendId, cancelInvoiceId);
            config.Deny(this.ObjectType, partiallyPaid, sendId, cancelInvoiceId);

            config.Deny(this.ObjectType, paid, Operations.Write, Operation.Execute);
            config.Deny(this.ObjectType, writtenOff, Operations.Write, Operation.Execute);
            config.Deny(this.ObjectType, cancelled, Operations.Write, Operation.Execute);
        }
コード例 #3
0
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };

            config.GrantAdministrator(this.ObjectType, full);
        }
コード例 #4
0
ファイル: Departments.cs プロジェクト: Allors/demo
        protected override void CustomSecure(Security config)
        {
            var full = new[] { Operation.Read, Operation.Write, Operation.Execute };

            config.GrantAdministrator(this.ObjectType, full);

            config.GrantEmployee(this.ObjectType, Operation.Read);
        }
コード例 #5
0
ファイル: Budgets.cs プロジェクト: Allors/apps
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };

            config.GrantAdministrator(this.ObjectType, full);

            var closed = new BudgetObjectStates(this.Session).Closed;
            var opened = new BudgetObjectStates(this.Session).Opened;

            config.Deny(this.ObjectType, closed, Operations.Write);

            config.Deny(this.ObjectType, closed, this.Meta.Close);
            config.Deny(this.ObjectType, opened, this.Meta.Reopen);
        }
コード例 #6
0
ファイル: SalesInvoiceItems.cs プロジェクト: Allors/apps
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };

            config.GrantAdministrator(this.ObjectType, full);

            ObjectState paid = new SalesInvoiceItemObjectStates(Session).Paid;
            ObjectState writtenOff = new SalesInvoiceItemObjectStates(Session).WrittenOff;
            ObjectState cancelled = new SalesInvoiceItemObjectStates(Session).Cancelled;

            config.Deny(this.ObjectType, paid, Operations.Write, Operation.Execute);
            config.Deny(this.ObjectType, writtenOff, Operations.Write, Operation.Execute);
            config.Deny(this.ObjectType, cancelled, Operations.Write, Operation.Execute);
        }
コード例 #7
0
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };
            config.GrantOwner(this.ObjectType, full);

            config.GrantCustomer(this.ObjectType, Meta.BirthDate, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Citizenship, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.FirstName, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Gender, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.LastName, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.MaritalStatus, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.MiddleName, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.MothersMaidenName, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.PartyContactMechanisms, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Passports, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Picture, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.PreferredCurrency, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Locale, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Titles, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.Salutation, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.SocialSecurityNumber, Operations.Read, Operations.Write);
            config.GrantCustomer(this.ObjectType, Meta.BankAccounts, Operations.Read, Operations.Write);

            config.GrantSales(this.ObjectType, Meta.BirthDate, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Citizenship, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.FirstName, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Gender, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.LastName, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.MaritalStatus, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.MiddleName, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.MothersMaidenName, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.PartyContactMechanisms, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Passports, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Picture, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.PreferredCurrency, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Locale, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Titles, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.Salutation, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.SocialSecurityNumber, Operations.Read, Operations.Write);
            config.GrantSales(this.ObjectType, Meta.BankAccounts, Operations.Read, Operations.Write);

            config.GrantSupplier(this.ObjectType, Meta.BirthDate, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Citizenship, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.FirstName, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Gender, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.LastName, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.MaritalStatus, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.MiddleName, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.MothersMaidenName, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.PartyContactMechanisms, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Passports, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Picture, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.PreferredCurrency, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Locale, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Titles, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.Salutation, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.SocialSecurityNumber, Operations.Read, Operations.Write);
            config.GrantSupplier(this.ObjectType, Meta.BankAccounts, Operations.Read, Operations.Write);

            config.GrantPartner(this.ObjectType, Meta.BirthDate, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Citizenship, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.FirstName, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Gender, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.LastName, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.MaritalStatus, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.MiddleName, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.MothersMaidenName, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.PartyContactMechanisms, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Passports, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Picture, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.PreferredCurrency, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Locale, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Titles, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.Salutation, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.SocialSecurityNumber, Operations.Read, Operations.Write);
            config.GrantPartner(this.ObjectType, Meta.BankAccounts, Operations.Read, Operations.Write);
        }
コード例 #8
0
ファイル: PurchaseOrders.cs プロジェクト: Allors/apps
        protected override void AppsSecure(Security config)
        {
            base.AppsSecure(config);

            var full = new[] { Operations.Read, Operations.Write, Operations.Execute };

            config.GrantAdministrator(this.ObjectType, full);

            config.GrantProcurement(this.ObjectType, full);
            config.GrantOperations(this.ObjectType, full);

            config.GrantSupplier(this.ObjectType, Meta.OrderNumber, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.OrderDate, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.CurrentOrderStatus, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.CurrentPaymentStatus, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.CurrentShipmentStatus, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.OrderStatuses, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.PaymentStatuses, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.ShipmentStatuses, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.TotalBasePrice, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.TotalDiscount, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.TotalSurcharge, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.TotalExVat, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.TotalVat, Operations.Read);
            config.GrantSupplier(this.ObjectType, Meta.TotalIncVat, Operations.Read);

            config.GrantProcurement(this.ObjectType, Meta.OrderNumber, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.OrderDate, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.CurrentOrderStatus, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.CurrentPaymentStatus, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.CurrentShipmentStatus, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.OrderStatuses, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.PaymentStatuses, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.ShipmentStatuses, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.TotalBasePrice, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.TotalDiscount, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.TotalSurcharge, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.TotalExVat, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.TotalVat, Operations.Read);
            config.GrantProcurement(this.ObjectType, Meta.TotalIncVat, Operations.Read);

            var created = new PurchaseOrderObjectStates(Session).Provisional;
            var onHold = new PurchaseOrderObjectStates(Session).OnHold;
            var requestsApproval = new PurchaseOrderObjectStates(Session).RequestsApproval;
            var inProcess = new PurchaseOrderObjectStates(Session).InProcess;
            var cancelled = new PurchaseOrderObjectStates(Session).Cancelled;
            var rejected = new PurchaseOrderObjectStates(Session).Rejected;
            var completed = new PurchaseOrderObjectStates(Session).Completed;
            var finished = new PurchaseOrderObjectStates(Session).Finished;

            var approve = Meta.Approve;
            var reject = Meta.Reject;
            var hold = Meta.Hold;
            var @continue = Meta.Continue;
            var confirm = Meta.Confirm;

            config.Deny(this.ObjectType, created, reject, approve, hold, @continue);
            config.Deny(this.ObjectType, requestsApproval, confirm, reject, approve, @continue);
            config.Deny(this.ObjectType, inProcess, confirm, reject, approve, @continue);
            config.Deny(this.ObjectType, onHold, confirm, reject, approve, hold);

            config.Deny(this.ObjectType, cancelled, Operation.Execute, Operations.Write);
            config.Deny(this.ObjectType, rejected, Operation.Execute, Operations.Write);
            config.Deny(this.ObjectType, completed, Operation.Execute, Operations.Write);
            config.Deny(this.ObjectType, finished, Operation.Execute, Operations.Write);
        }