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 ; }
This method retrieves all security permissions contained within the specified node .