You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
638 B

  1. package types
  2. const (
  3. // first 32 bits of BasePermission are for chain, second 32 are for snative
  4. FirstSNativePermFlag PermFlag = 1 << 32
  5. )
  6. // we need to reset iota with no const block
  7. const (
  8. // each snative has an associated permission flag
  9. HasBasePerm PermFlag = FirstSNativePermFlag << iota
  10. SetBasePerm
  11. UnsetBasePerm
  12. SetGlobalPerm
  13. ClearBasePerm
  14. HasRole
  15. AddRole
  16. RmRole
  17. NumSNativePermissions uint = 8 // NOTE adjust this too
  18. TopSNativePermFlag PermFlag = FirstSNativePermFlag << (NumSNativePermissions - 1)
  19. AllSNativePermFlags PermFlag = (TopSNativePermFlag | (TopSNativePermFlag - 1)) &^ (FirstSNativePermFlag - 1)
  20. )