]> git.stg.codes - stg.git/blobdiff - include/stg/admin_conf.inc.h
Service and corporation permissions added
[stg.git] / include / stg / admin_conf.inc.h
index 44897a08e6f2b0df9d24adc13bb53f4fe2054051..f744936e6d5cbea9d51db5ca8146a555aec2f823 100644 (file)
@@ -8,28 +8,32 @@
 #define ADMIN_CONF_INC_H
 
 inline
-uint16_t PRIV::ToInt() const
+uint32_t PRIV::ToInt() const
 {
-uint16_t p = (userStat   << 0)  |
+uint32_t p = (userStat   << 0)  |
              (userConf   << 2)  |
              (userCash   << 4)  |
              (userPasswd << 6)  |
              (userAddDel << 8)  |
              (adminChg   << 10) |
-             (tariffChg  << 12);
+             (tariffChg  << 12) |
+             (serviceChg << 14) |
+             (corpChg    << 16);
 return p;
 }
 
 inline
-void PRIV::FromInt(uint16_t p)
+void PRIV::FromInt(uint32_t p)
 {
-userStat   = (p & 0x0003) >> 0x00; // 1+2
-userConf   = (p & 0x000C) >> 0x02; // 4+8
-userCash   = (p & 0x0030) >> 0x04; // 10+20
-userPasswd = (p & 0x00C0) >> 0x06; // 40+80
-userAddDel = (p & 0x0300) >> 0x08; // 100+200
-adminChg   = (p & 0x0C00) >> 0x0A; // 400+800
-tariffChg  = (p & 0x3000) >> 0x0C; // 1000+2000
+userStat   = (p & 0x00000003) >> 0x00; // 1+2
+userConf   = (p & 0x0000000C) >> 0x02; // 4+8
+userCash   = (p & 0x00000030) >> 0x04; // 10+20
+userPasswd = (p & 0x000000C0) >> 0x06; // 40+80
+userAddDel = (p & 0x00000300) >> 0x08; // 100+200
+adminChg   = (p & 0x00000C00) >> 0x0A; // 400+800
+tariffChg  = (p & 0x00003000) >> 0x0C; // 1000+2000
+serviceChg = (p & 0x0000C000) >> 0x0E; // 4000+8000
+corpChg    = (p & 0x00030000) >> 0x10; // 10000+20000
 }
 
 #endif