Customer access
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<string> contactTags, List<string> inTags, List<string> outTags)
|
||||
private static bool CustomerUserEffectiveRightsAllowed(bool allowed, List<string> contactTags, List<string> 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;
|
||||
|
||||
@@ -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<string> CustomerWorkOrderReport1Tags { get; set; } = new List<string>();
|
||||
|
||||
public long? CustomerTagWorkOrderReport2Id { get; set; }
|
||||
public List<string> CustomerWorkOrderReport2Tags { get; set; } = new List<string>();
|
||||
|
||||
public long? CustomerTagWorkOrderReport3Id { get; set; }
|
||||
public List<string> CustomerWorkOrderReport3Tags { get; set; } = new List<string>();
|
||||
|
||||
public long? CustomerTagWorkOrderReport4Id { get; set; }
|
||||
public List<string> CustomerWorkOrderReport4Tags { get; set; } = new List<string>();
|
||||
|
||||
public long? CustomerTagWorkOrderReport5Id { get; set; }
|
||||
public List<string> CustomerWorkOrderReport5Tags { get; set; } = new List<string>();
|
||||
|
||||
public string CustomerServiceRequestInfoText { get; set; }
|
||||
|
||||
public bool CustomerAllowCSR { get; set; }
|
||||
public List<string> CustomerAllowCSRInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowCSROutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowViewWO { get; set; }
|
||||
public List<string> CustomerAllowViewWOInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowViewWOOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowWOWiki { get; set; }
|
||||
public List<string> CustomerAllowWOWikiInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowWOWikiOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowUserSettings { get; set; }
|
||||
public List<string> CustomerAllowUserSettingsInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowUserSettingsOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowNotifyServiceImminent { get; set; }
|
||||
public List<string> CustomerAllowNotifyServiceImminentInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowNotifyServiceImminentOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowNotifyCSRAccepted { get; set; }
|
||||
public List<string> CustomerAllowNotifyCSRAcceptedInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowNotifyCSRAcceptedOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowNotifyCSRRejected { get; set; }
|
||||
public List<string> CustomerAllowNotifyCSRRejectedInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowNotifyCSRRejectedOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowNotifyWOCreated { get; set; }
|
||||
public List<string> CustomerAllowNotifyWOCreatedInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowNotifyWOCreatedOutTags { get; set; } = new List<string>();
|
||||
|
||||
public bool CustomerAllowNotifyWOCompleted { get; set; }
|
||||
public List<string> CustomerAllowNotifyWOCompletedInTags { get; set; } = new List<string>();
|
||||
public List<string> CustomerAllowNotifyWOCompletedOutTags { get; set; } = new List<string>();
|
||||
|
||||
public string SignatureTitle { get; set; }
|
||||
public string SignatureHeader { get; set; }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user