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); }
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); }