public void apply(PermissionSet<PermissionType> permissionSet)
        throws GuacamoleException {

        // Add any added permissions
        if (!addedPermissions.isEmpty())
            permissionSet.addPermissions(addedPermissions);

        // Remove any removed permissions
        if (!removedPermissions.isEmpty())
            permissionSet.removePermissions(removedPermissions);

    }
Applies all queued changes to the given permission set.

@param permissionSet
    The permission set to add and remove permissions from.

@throws GuacamoleException
    If an error occurs while manipulating the permissions of the given
    permission set.
guacamole/src/main/java/org/apache/guacamole/rest/permission/PermissionSetPatch.java