diff --git a/docs/8.0/ayanova/docs/adm-global-settings.md b/docs/8.0/ayanova/docs/adm-global-settings.md index b75452f9..2d12aff8 100644 --- a/docs/8.0/ayanova/docs/adm-global-settings.md +++ b/docs/8.0/ayanova/docs/adm-global-settings.md @@ -10,10 +10,7 @@ This section controls the rights granted to Customer type Users (known as **"Con Each feature that Contacts have access to in AyaNova is listed with controls to grant or deny rights to that feature: * **Active** checkbox - enables or disables this particular feature entirely -* **Tagged With** tag control - grants access if tags on Contacts, Customers or Head Offices (related to Contact user) have **any** matching tags -* **Not Tagged With** tag control - denies access if tags on Contacts, Customers or Head Offices (related to Contact user) **any** matching tags - -"Active" has the highest priority followed by "Not tagged with" and lastly "Tagged with". This means "Not tagged with" takes precedence over "Tagged with" if both match a Contact or it's ancestors tags. +* **Tagged With** tag control - grants access **ONLY** if tags on Contacts, Customers or Head Offices (related to Contact user) have *any* matching tags Tags are matched to **any single** matching tag in the selected tags. This means the tags "red, green, brown" will match to a Contact tagged with any one of "red", "green" or "brown". @@ -21,12 +18,12 @@ Tags are matched to **any single** matching tag in the selected tags. This mean These settings control access to features in AyaNova for Customer Contact users -* Default work order report - sets which Work order report is available to Customers through AyaNova. If not set they are not able to print their own work order reports +* Default work order report - sets which Work order report is available to Customers through AyaNova. If not set they are not able to view or download their own work order reports * Customer Service Request message to Customer - sets message displayed to the Customer in their Customer Service Request form. This optional display is available to provide specific instructions to Customers when they fill out Customer service requests. It is displayed as plain text at the top of the CSR form * Customer Service Requests - Customer service requests: viewing a data table of CSR's, creating new CSR's and viewing existing CSR's * WorkOrders - Customer Work orders: view a data table of their work orders, and optionaly print work orders * Work order header Wiki - View the Wiki section of the Work order Header (no other Wiki parts of Work Order) if they are able to view their own work orders -* Work order header Attachments - Grants access for the customer to be able to download *any* of the attachments for that work order set on it's header only +* Work order header Attachments - Grants access for the customer to be able to download *any* of the attachments for that work order set in it's header only (no other Attachment areas of Work Order) * User settings - Contact User account settings where users can set their personal account settings such as notification email address, login name and password, locale settings etc * Notification "Service reminder" - ability to subscribe to the "Service Reminder" notification for their own work orders * Notification "CSR Accepted" - ability to subscribe to their Customer Service Request being accepted for service diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index a30288a6..a9dc5eb9 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -145,48 +145,39 @@ namespace AyaNova.Biz return new CustomerRightsRecord( CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowCSR, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowCSRInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowCSROutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowCSRInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowViewWO, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowViewWOInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowViewWOOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowViewWOInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWiki, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWikiInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWikiOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowWOWikiInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowUserSettings, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowUserSettingsInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowUserSettingsOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowUserSettingsInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyServiceImminent, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyServiceImminentInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyServiceImminentOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyServiceImminentInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRAccepted, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRAcceptedInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRAcceptedOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRAcceptedInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRRejected, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRRejectedInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRRejectedOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyCSRRejectedInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreated, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreatedInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreatedOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCreatedInTags), CustomerUserEffectiveRightsAllowed(AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompleted, AllTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompletedInTags, - AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompletedOutTags), + AyaNova.Util.ServerGlobalBizSettings.Cache.CustomerAllowNotifyWOCompletedInTags), EntityId, EntityActive ); @@ -195,25 +186,22 @@ namespace AyaNova.Biz } - private static bool CustomerUserEffectiveRightsAllowed(bool allowed, List contactTags, List inTags, List outTags) + private static bool CustomerUserEffectiveRightsAllowed(bool allowed, List contactTags, List inTags) { - //Note: tag match rule as planned and documented is that it's a match if *any* single tag in intags or outtags are a match to any single tag in contact tags, + //Note: tag match rule as planned and documented is that it's a match if *any* single tag in intags are a match to any single tag in contact tags, //not the whole list, just any one of them which differs from how notifications are checked for example which need to *all* match //if outright banned then quickest short circuit here if (!allowed) return false; //No tags to verify means allowed - if (inTags.Count == 0 && outTags.Count == 0) return true; + if (inTags.Count == 0 ) return true; //if contact tags is empty and inclusive is empty then it's a match and can short circuit - if (contactTags.Count == 0 && inTags.Count == 0) return true; + if (contactTags.Count == 0) return true; //if contact tags is empty and inclusive is not empty then no match is possible - if (contactTags.Count == 0 && inTags.Count > 0) return false; - - //any of the exclusive tags in contact tags? - if (contactTags.Intersect(outTags).Any()) return false; + if (contactTags.Count == 0 ) return false; //any of the inclusive tags in contact tags? if (contactTags.Intersect(inTags).Any()) return true; diff --git a/server/AyaNova/models/GlobalBizSettings.cs b/server/AyaNova/models/GlobalBizSettings.cs index 1535abc9..ca892541 100644 --- a/server/AyaNova/models/GlobalBizSettings.cs +++ b/server/AyaNova/models/GlobalBizSettings.cs @@ -41,48 +41,55 @@ namespace AyaNova.Models public TimeSpan WorkOrderCompleteByAge { get; set; } = TimeSpan.Zero;//was workorderclosebyage public bool AllowScheduleConflicts { get; set; } = true; - + //CUSTOMER ACCESS FEATURES AND SETTINGS public long? CustomerDefaultWorkOrderReportId { get; set; } + + public long? CustomerTagWorkOrderReport1Id { get; set; } + public List CustomerWorkOrderReport1Tags { get; set; } = new List(); + + public long? CustomerTagWorkOrderReport2Id { get; set; } + public List CustomerWorkOrderReport2Tags { get; set; } = new List(); + + public long? CustomerTagWorkOrderReport3Id { get; set; } + public List CustomerWorkOrderReport3Tags { get; set; } = new List(); + + public long? CustomerTagWorkOrderReport4Id { get; set; } + public List CustomerWorkOrderReport4Tags { get; set; } = new List(); + + public long? CustomerTagWorkOrderReport5Id { get; set; } + public List CustomerWorkOrderReport5Tags { get; set; } = new List(); + public string CustomerServiceRequestInfoText { get; set; } public bool CustomerAllowCSR { get; set; } public List CustomerAllowCSRInTags { get; set; } = new List(); - public List CustomerAllowCSROutTags { get; set; } = new List(); public bool CustomerAllowViewWO { get; set; } public List CustomerAllowViewWOInTags { get; set; } = new List(); - public List CustomerAllowViewWOOutTags { get; set; } = new List(); public bool CustomerAllowWOWiki { get; set; } public List CustomerAllowWOWikiInTags { get; set; } = new List(); - public List CustomerAllowWOWikiOutTags { get; set; } = new List(); public bool CustomerAllowUserSettings { get; set; } public List CustomerAllowUserSettingsInTags { get; set; } = new List(); - public List CustomerAllowUserSettingsOutTags { get; set; } = new List(); public bool CustomerAllowNotifyServiceImminent { get; set; } public List CustomerAllowNotifyServiceImminentInTags { get; set; } = new List(); - public List CustomerAllowNotifyServiceImminentOutTags { get; set; } = new List(); public bool CustomerAllowNotifyCSRAccepted { get; set; } public List CustomerAllowNotifyCSRAcceptedInTags { get; set; } = new List(); - public List CustomerAllowNotifyCSRAcceptedOutTags { get; set; } = new List(); public bool CustomerAllowNotifyCSRRejected { get; set; } public List CustomerAllowNotifyCSRRejectedInTags { get; set; } = new List(); - public List CustomerAllowNotifyCSRRejectedOutTags { get; set; } = new List(); public bool CustomerAllowNotifyWOCreated { get; set; } public List CustomerAllowNotifyWOCreatedInTags { get; set; } = new List(); - public List CustomerAllowNotifyWOCreatedOutTags { get; set; } = new List(); public bool CustomerAllowNotifyWOCompleted { get; set; } public List CustomerAllowNotifyWOCompletedInTags { get; set; } = new List(); - public List CustomerAllowNotifyWOCompletedOutTags { get; set; } = new List(); public string SignatureTitle { get; set; } public string SignatureHeader { get; set; } diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index b92f42af..f4d9a5f6 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -263,15 +263,15 @@ namespace AyaNova.Util + "signaturefooter TEXT, " + "customerservicerequestinfotext TEXT, " - + "customerallowcsr BOOL DEFAULT FALSE, customerallowcsrintags VARCHAR(255) ARRAY, customerallowcsrouttags VARCHAR(255) ARRAY, " - + "customerallowviewwo BOOL DEFAULT FALSE, customerallowviewwointags VARCHAR(255) ARRAY, customerallowviewwoouttags VARCHAR(255) ARRAY, " - + "customerallowwowiki BOOL DEFAULT FALSE, customerallowwowikiintags VARCHAR(255) ARRAY, customerallowwowikiouttags VARCHAR(255) ARRAY, " - + "customerallowusersettings BOOL DEFAULT FALSE, customerallowusersettingsintags VARCHAR(255) ARRAY, customerallowusersettingsouttags VARCHAR(255) ARRAY, " - + "customerallownotifyserviceimminent BOOL DEFAULT FALSE, customerallownotifyserviceimminentintags VARCHAR(255) ARRAY, customerallownotifyserviceimminentouttags VARCHAR(255) ARRAY, " - + "customerallownotifycsraccepted BOOL DEFAULT FALSE, customerallownotifycsracceptedintags VARCHAR(255) ARRAY, customerallownotifycsracceptedouttags VARCHAR(255) ARRAY, " - + "customerallownotifycsrrejected BOOL DEFAULT FALSE, customerallownotifycsrrejectedintags VARCHAR(255) ARRAY, customerallownotifycsrrejectedouttags VARCHAR(255) ARRAY, " - + "customerallownotifywocreated BOOL DEFAULT FALSE, customerallownotifywocreatedintags VARCHAR(255) ARRAY, customerallownotifywocreatedouttags VARCHAR(255) ARRAY, " - + "customerallownotifywocompleted BOOL DEFAULT FALSE, customerallownotifywocompletedintags VARCHAR(255) ARRAY, customerallownotifywocompletedouttags VARCHAR(255) ARRAY " + + "customerallowcsr BOOL DEFAULT FALSE, customerallowcsrintags VARCHAR(255) ARRAY, " + + "customerallowviewwo BOOL DEFAULT FALSE, customerallowviewwointags VARCHAR(255) ARRAY, " + + "customerallowwowiki BOOL DEFAULT FALSE, customerallowwowikiintags VARCHAR(255) ARRAY, " + + "customerallowusersettings BOOL DEFAULT FALSE, customerallowusersettingsintags VARCHAR(255) ARRAY, " + + "customerallownotifyserviceimminent BOOL DEFAULT FALSE, customerallownotifyserviceimminentintags VARCHAR(255) ARRAY, " + + "customerallownotifycsraccepted BOOL DEFAULT FALSE, customerallownotifycsracceptedintags VARCHAR(255) ARRAY, " + + "customerallownotifycsrrejected BOOL DEFAULT FALSE, customerallownotifycsrrejectedintags VARCHAR(255) ARRAY, " + + "customerallownotifywocreated BOOL DEFAULT FALSE, customerallownotifywocreatedintags VARCHAR(255) ARRAY, " + + "customerallownotifywocompleted BOOL DEFAULT FALSE, customerallownotifywocompletedintags VARCHAR(255) ARRAY" + ")"); //create global ops BACKUP settings table