code: public static int fromPermissions(String str) {
          int result;
  
          result = 0;
          for (int i = 0; i < str.length(); i++) {
              result = result << 1;
              if (str.charAt(i) != '-') {
                  result |= 1;
              }
          }
          return result;
      }
docs: --