code: private List<PermissionFactory> retrievePermissionSet(final OperationContext context, final ModelNode node) throws OperationFailedException {
  
          final List<PermissionFactory> permissions = new ArrayList<>();
  
          if (node != null && node.isDefined()) {
              for (ModelNode permissionNode : node.asList()) {
                  String permissionClass = CLASS.resolveModelAttribute(context, permissionNode).asString();
                  String permissionName = null;
                  if (permissionNode.hasDefined(PERMISSION_NAME))
                      permissionName = NAME.resolveModelAttribute(context, permissionNode).asString();
                  String permissionActions = null;
                  if (permissionNode.hasDefined(PERMISSION_ACTIONS))
                      permissionActions = ACTIONS.resolveModelAttribute(context, permissionNode).asString();
                  String moduleName = null;
                  if(permissionNode.hasDefined(PERMISSION_MODULE)) {
                      moduleName =  MODULE.resolveModelAttribute(context, permissionNode).asString();
                  }
                  ClassLoader cl = WildFlySecurityManager.getClassLoaderPrivileged(this.getClass());
                  if(moduleName != null) {
                      try {
                          cl = Module.getBootModuleLoader().loadModule(ModuleIdentifier.fromString(moduleName)).getClassLoader();
                      } catch (ModuleLoadException e) {
                          throw new OperationFailedException(e);
                      }
                  }
  
                  permissions.add(new LoadedPermissionFactory(cl,
                          permissionClass, permissionName, permissionActions));
              }
          }
          return permissions;
      }
docs: This method retrieves all security permissions contained within the specified node.
  
  @param context the {@link OperationContext} used to resolve the permission attributes.
  @param node the {@link ModelNode} that might contain security permissions metadata.
  @return a {@link List} containing the retrieved permissions. They are wrapped as {@link PermissionFactory} instances.
  @throws OperationFailedException if an error occurs while retrieving the security permissions.