code: @Programmatic
      public ApplicationPermission newPermission(
              final ApplicationRole role,
              final ApplicationPermissionRule rule,
              final ApplicationPermissionMode mode,
              final ApplicationFeatureType featureType,
              final String featureFqn) {
          final ApplicationFeatureId featureId = ApplicationFeatureId.newFeature(featureType, featureFqn);
          final ApplicationFeature feature = applicationFeatureRepository.findFeature(featureId);
          if(feature == null) {
              container.warnUser("No such " + featureType.name().toLowerCase() + ": " + featureFqn);
              return null;
          }
          return newPermissionNoCheck(role, rule, mode, featureType, featureFqn);
      }
docs: region > newPermission (programmatic)