using System;

namespace AyaNova.Biz
{
    /// <summary>
    /// Authorization roles
    /// </summary>
    [Flags]
    public enum AuthorizationRoles : int
    {
        //https://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c
        //MAX 31 (2147483647)!!! or will overflow int and needs to be turned into a long
        //Must be a power of two: https://en.wikipedia.org/wiki/Power_of_two

        ///<summary>No role set</summary>
        NoRole = 0,
        ///<summary>BizAdminLimited</summary>
        BizAdminLimited = 1,
        ///<summary>BizAdminFull</summary>
        BizAdminFull = 2,
        ///<summary>DispatchLimited</summary>
        DispatchLimited = 4,
        ///<summary>DispatchFull</summary>
        DispatchFull = 8,
        ///<summary>InventoryLimited</summary>
        InventoryLimited = 16,
        ///<summary>InventoryFull</summary>
        InventoryFull = 32,
        ///<summary>AccountingFull</summary>
        AccountingFull = 64,//No limited role, not sure if there is a need
        ///<summary>TechLimited</summary>
        TechLimited = 128,
        ///<summary>TechFull</summary>
        TechFull = 256,
        ///<summary>SubContractorLimited</summary>
        SubContractorLimited = 512,
        ///<summary>SubContractorFull</summary>
        SubContractorFull = 1024,
        ///<summary>ClientLimited</summary>
        CustomerLimited = 2048,
        ///<summary>ClientFull</summary>
        CustomerFull = 4096,
        ///<summary>OpsAdminLimited</summary>
        OpsAdminLimited = 8192,
        ///<summary>OpsAdminFull</summary>
        OpsAdminFull = 16384,
        ///<summary>SalesFull</summary>
        SalesFull = 32768,
        ///<summary>SalesLimited</summary>
        SalesLimited = 65536,


        ///<summary>Anyone of any role</summary>
        All = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
        InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
        SubContractorFull | CustomerLimited | CustomerFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited,

        ///<summary>Anyone inside company</summary>
        AllInternalStaff = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
        InventoryFull | AccountingFull | TechLimited | TechFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited,

        ///<summary>Anyone except customers</summary>
        AllExceptCustomers = BizAdminLimited | BizAdminFull | DispatchLimited | DispatchFull | InventoryLimited |
        InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
        SubContractorFull | OpsAdminLimited | OpsAdminFull | SalesFull | SalesLimited

       

    }//end AuthorizationRoles
     //, 65536, 131072, 262144, 524288, 1,048,576
}//end namespace GZTW.AyaNova.BLL

